Panel Interface Board  1
inszt_hvps_test.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps_test.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:52:19 2020
5 */
6 /**************************************************************************************/
27 /**************************************************************************************/
28 /**************************************************************************************/
29 /* Section: Included Files */
30 /**************************************************************************************/
31 /**************************************************************************************/
32 /* This section lists the other files that are included in this file.
33  */
34 #define QQQdialect MPLABX
35 #undef QQQ146
36 #undef QQQ148
37 #undef QQQbndchk
38 #undef QQQ294
39 #undef QQQEMBEDDEDICE
40  /* Note: for BITMAP execution histories QQQthreaded is not defined */
41 #undef QQQthreaded
42 #undef QQQdo178b
43 #undef QQQfixbra
44 #define QQQswitch3
45 #undef QQQternary
46 #define QQQswitch
47 #undef QQQmacrof
48 #undef QQQMULTIPROCESSEXH
49 #undef QQFLUSH
50 #undef QQNEWBS
51 #define qqqMaxBranchDepth 20
52 #define QQQstructbitmap
53  static int qqqqbmselwidth = 32 ;
54  static int zzfileid = 67;
55 #define QQQnumfil 23
56 #undef QQQALGONE
57 #undef QQQVCLFLG
58 #undef QQQFORKFL
59 #undef QQQIADDRF
60 #undef QQQRTI
61 #undef QQQPERFA
62 #undef QQQADRMOD
63 #undef QQQDCAPFL
64 #undef QQQTEMPLATEONLY
65 #define QQQNOATEXIT
66 #define QQQUPLOADATEND
67 #define QQQNOSTDIO
68 #undef QQQASHLINGVITRA
69 #define QQQBITMAP
70  #define qqqbitmapint unsigned int
71 #undef QQQBITMAPMCDC
72 #undef QQQTIC2XSERIALIO
73 #undef QQQTIC2XFLASH
74 #undef QQQCOMPRESSED_EXH
75 #undef QQQMAINFL
76 #define QQQSINGLEFILE
77 #define QQQFILEID
78 #define QQQseparate
79 extern int QQQindicator;
80 static int QQQfirstmcdc=1;
81 #define hvps_test_67zzopen zzopen
82  extern int hvps_test_67zzopen ;
83 #define hvps_test_67zqqzqz1 zqqzqz1
84 #define QQQLDRA_PORT
85 #ifndef QQQLDRA_PORT
86 #define FILEPOINT FILE * f,
87 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
88 #include <stdio.h>
89  /* ----------------------------------------------------------------------* 100 *
90  * If stdio.h is not available then insert:
91  * typedef int * FILE;
92  * -----------------------------------------------------------------------------
93  */
94 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
95 #else /* QQQLDRA_PORT */
96 #define FILEPOINT
97 /*************************** LDRA_PORT *********************************/
98 #ifdef QQQ_SHLAYOUT
99 static int tbrun_mode=1;
100 #else
101 static int tbrun_mode=0;
102 #endif /* QQQ_SHLAYOUT */
103 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
104 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
105 #ifndef QQQ_SHLAYOUT
106 #ifdef QQQMAINFL
107 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
108 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
109 #endif /* QQQMAINFL */
110 #endif /* QQQ_SHLAYOUT */
111 /************************ END OF LDRA_PORT *****************************/
112 #endif /* QQQLDRA_PORT */
113 #ifndef QQQnumfil
114 #define QQQnumfil 40 /* default setting */
115 #endif /* QQQnumfil */
116 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
117 #ifndef LDRA_VOID_FUNC
118 #define LDRA_VOID_FUNC
119  typedef void(*ldra_void_function)();
120 #endif
121 #if defined(QQQMAINFL)
122  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
123  through the target you would have to set this to 0 before calling the qqqupload.
124  Move this into ldra_port mechanism. */
125  int qqqshell_upload = 0;
126  int QQQfcn_ptr_num = 0;
127  static int qqqisinitialised = 0;
130  void qqqtotalupload(void);
131  void qqqtotalreset(void);
133  qqqaccumupload[x]=y;
134  qqqaccumreset[x]=z;
135  QQQfcn_ptr_num++;
136  }
137 #else /* (QQQMAINFL) */
138  extern int QQQfcn_ptr_num;
141  static int qqqstructzzopen = 0;
142 #endif /* defined(QQQMAINFL) */
143 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
144 #ifdef QQQ_KEEPCOMMENTS
145  /* -----------------------------------------------------------------------* 101 *
146  * Special settings for systems lacking standard functions.
147  * To include code for fprintf define ldra_fprintf
148  * To include code for sscanf define ldra_sscanf
149  * -----------------------------------------------------------------------------
150  */
151 #endif /* QQQ_KEEPCOMMENTS */
152 #if !defined(QQQSUPPRESS_UNDEF)
153 #undef ldra_fprintf
154 #undef ldra_sscanf
155 #endif /* !defined(QQQSUPPRESS_UNDEF) */
156  /* #define ldra_fprintf */
157  /* #define ldra_sscanf */
158 #undef QQQHITMAP_STORAGE
159 #undef qqnull_params
160 #define qqnull_params void
161 #define QQQ_PROTOTYPE_DEF
162  /* Conventional Instrumentation */
163 #undef QQ_ANSI_PROTOTYPE
164 #ifdef __STDC__
165 #define QQ_ANSI_PROTOTYPE 1
166 #else /* __STDC__ */
167 #ifdef VAXC
168 #define QQ_ANSI_PROTOTYPE 1
169 #endif /* VAXC */
170 #endif /* __STDC__ */
171  static unsigned char qqqzzglobflag = 0;
172  static struct bitmapstruct_t
173  {
174 #define ELEMENT(N) qqqbitmapint element##N;
175 #define LASTELEMENT
176 #include "hvps_test_67zbelem.def"
177 #undef ELEMENT
178 #undef LASTELEMENT
179  } bitmapstruct = {
180 #define ELEMENT(N) 0,
181 #undef LASTELEMENT
182 #include "hvps_test_67zbelem.def"
183 #undef ELEMENT
184  0};
185  static void qqoutput(FILEPOINT char * s,int i);
186  static void qqoutput2(FILEPOINT char * s,int i, int j);
187  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
188  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
189  static void qqoutput0(FILEPOINT char * s);
190  static int hvps_test_67zqqzqz(qqnull_params);
191  static int hvps_test_67zqqzqz1(qqnull_params);
192  static int hvps_test_67zqendz (int qqqi);
193  static int hvps_test_67zqzqzq (int qqqi);
194  static void qqqupload(qqnull_params);
195  static void qqqbitmapreset(qqnull_params);
196 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
197 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps_test.h */
198 /**************************************************************************************/
213 /**************************************************************************************/
214 #ifndef HVPS_TEST_H /* Guard against multiple inclusion */
215 #define HVPS_TEST_H
216 /**************************************************************************************/
217 /**************************************************************************************/
218 /* Section: Included Files */
219 /**************************************************************************************/
220 /**************************************************************************************/
221 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
222 /*******************************************************************************
223  System Definitions
224  File Name:
225  system_definitions.h
226  Summary:
227  MPLAB Harmony project system definitions.
228  Description:
229  This file contains the system-wide prototypes and definitions for an MPLAB
230  Harmony project.
231  *******************************************************************************/
232 //DOM-IGNORE-BEGIN
233 /*******************************************************************************
234 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
235 Microchip licenses to you the right to use, modify, copy and distribute
236 Software only when embedded on a Microchip microcontroller or digital signal
237 controller that is integrated into your product or third party product
238 (pursuant to the sublicense terms in the accompanying license agreement).
239 You should refer to the license agreement accompanying this Software for
240 additional information regarding your rights and obligations.
241 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
242 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
243 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
244 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
245 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
246 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
247 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
248 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
249 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
250 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
251  *******************************************************************************/
252 //DOM-IGNORE-END
253 #ifndef _SYS_DEFINITIONS_H
254 #define _SYS_DEFINITIONS_H
255 // *****************************************************************************
256 // *****************************************************************************
257 // Section: Included Files
258 // *****************************************************************************
259 // *****************************************************************************
260 #include <stdint.h>
261 #include <stddef.h>
262 #include <stdbool.h>
263 #include "system/common/sys_common.h"
264 #include "system/common/sys_module.h"
265 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
266 /*******************************************************************************
267  Input Capture Driver Interface Declarations for Static Single Instance Driver
268  Company:
269  Microchip Technology Inc.
270  File Name:
271  help_drv_ic.h
272  Summary:
273  Input Capture driver interface declarations for the static single instance
274  driver.
275  Description:
276  The Input Capture device driver provides a simple interface to manage the
277  Input Capture modules on Microchip microcontrollers. This file defines
278  the interface declarations for the IC driver.
279 
280  Remarks:
281  Static interfaces incorporate the driver instance number within the names
282  of the routines, eliminating the need for an object ID or object handle.
283 
284  Static single-open interfaces also eliminate the need for the open handle.
285 *******************************************************************************/
286 //DOM-IGNORE-BEGIN
287 /*******************************************************************************
288 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
289 Microchip licenses to you the right to use, modify, copy and distribute
290 Software only when embedded on a Microchip microcontroller or digital signal
291 controller that is integrated into your product or third party product
292 (pursuant to the sublicense terms in the accompanying license agreement).
293 You should refer to the license agreement accompanying this Software for
294 additional information regarding your rights and obligations.
295 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
296 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
297 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
298 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
299 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
300 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
301 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
302 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
303 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
304 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
305 *******************************************************************************/
306 //DOM-IGNORE-END
307 #ifndef _DRV_IC_H
308 #define _DRV_IC_H
309 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
310 /*******************************************************************************
311  MPLAB Harmony System Configuration Header
312  File Name:
313  system_config.h
314  Summary:
315  Build-time configuration header for the system defined by this MPLAB Harmony
316  project.
317  Description:
318  An MPLAB Project may have multiple configurations. This file defines the
319  build-time options for a single configuration.
320  Remarks:
321  This configuration header must not define any prototypes or data
322  definitions (or include any files that do). It only provides macro
323  definitions for build-time configuration options that are not instantiated
324  until used by another MPLAB Harmony module or application.
325  Created with MPLAB Harmony Version 2.06
326 *******************************************************************************/
327 // DOM-IGNORE-BEGIN
328 /*******************************************************************************
329 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
330 Microchip licenses to you the right to use, modify, copy and distribute
331 Software only when embedded on a Microchip microcontroller or digital signal
332 controller that is integrated into your product or third party product
333 (pursuant to the sublicense terms in the accompanying license agreement).
334 You should refer to the license agreement accompanying this Software for
335 additional information regarding your rights and obligations.
336 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
337 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
338 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
339 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
340 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
341 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
342 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
343 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
344 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
345 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
346 *******************************************************************************/
347 // DOM-IGNORE-END
348 #ifndef _SYSTEM_CONFIG_H
349 #define _SYSTEM_CONFIG_H
350 // *****************************************************************************
351 // *****************************************************************************
352 // Section: Included Files
353 // *****************************************************************************
354 // *****************************************************************************
355 /* This section Includes other configuration headers necessary to completely
356  define this configuration.
357 */
358 // DOM-IGNORE-BEGIN
359 // DOM-IGNORE-END
360 // *****************************************************************************
361 // *****************************************************************************
362 // Section: System Service Configuration
363 // *****************************************************************************
364 // *****************************************************************************
365 // *****************************************************************************
366 /* Common System Service Configuration Options
367 */
368 #define SYS_VERSION_STR "2.06"
369 #define SYS_VERSION 20600
370 // *****************************************************************************
371 /* Clock System Service Configuration Options
372 */
373 #define SYS_CLK_FREQ 200000000ul
374 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
375 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
376 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
377 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
378 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
379 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
380 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
381 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
382 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
383 /*** Ports System Service Configuration ***/
384 #define SYS_PORT_A_ANSEL 0x3F00
385 #define SYS_PORT_A_TRIS 0xFFED
386 #define SYS_PORT_A_LAT 0x0010
387 #define SYS_PORT_A_ODC 0x0000
388 #define SYS_PORT_A_CNPU 0x0020
389 #define SYS_PORT_A_CNPD 0x0000
390 #define SYS_PORT_A_CNEN 0x0021
391 #define SYS_PORT_B_ANSEL 0x10C8
392 #define SYS_PORT_B_TRIS 0x91FF
393 #define SYS_PORT_B_LAT 0x0000
394 #define SYS_PORT_B_ODC 0x0000
395 #define SYS_PORT_B_CNPU 0x0000
396 #define SYS_PORT_B_CNPD 0x0000
397 #define SYS_PORT_B_CNEN 0x0000
398 #define SYS_PORT_C_ANSEL 0xCFE1
399 #define SYS_PORT_C_TRIS 0xFFFF
400 #define SYS_PORT_C_LAT 0x0000
401 #define SYS_PORT_C_ODC 0x0000
402 #define SYS_PORT_C_CNPU 0x0000
403 #define SYS_PORT_C_CNPD 0x0000
404 #define SYS_PORT_C_CNEN 0x0000
405 #define SYS_PORT_D_ANSEL 0xC100
406 #define SYS_PORT_D_TRIS 0xFFFF
407 #define SYS_PORT_D_LAT 0x0000
408 #define SYS_PORT_D_ODC 0x0000
409 #define SYS_PORT_D_CNPU 0x0000
410 #define SYS_PORT_D_CNPD 0x0000
411 #define SYS_PORT_D_CNEN 0x0000
412 #define SYS_PORT_E_ANSEL 0xFC00
413 #define SYS_PORT_E_TRIS 0xFDFF
414 #define SYS_PORT_E_LAT 0x0000
415 #define SYS_PORT_E_ODC 0x0000
416 #define SYS_PORT_E_CNPU 0x0000
417 #define SYS_PORT_E_CNPD 0x0000
418 #define SYS_PORT_E_CNEN 0x0000
419 #define SYS_PORT_F_ANSEL 0xCEC0
420 #define SYS_PORT_F_TRIS 0xEFFF
421 #define SYS_PORT_F_LAT 0x0000
422 #define SYS_PORT_F_ODC 0x0000
423 #define SYS_PORT_F_CNPU 0x0000
424 #define SYS_PORT_F_CNPD 0x0000
425 #define SYS_PORT_F_CNEN 0x0000
426 #define SYS_PORT_G_ANSEL 0x8CBC
427 #define SYS_PORT_G_TRIS 0xDFFF
428 #define SYS_PORT_G_LAT 0x0000
429 #define SYS_PORT_G_ODC 0x0000
430 #define SYS_PORT_G_CNPU 0x0000
431 #define SYS_PORT_G_CNPD 0x0000
432 #define SYS_PORT_G_CNEN 0x0000
433 #define SYS_PORT_H_ANSEL 0x0070
434 #define SYS_PORT_H_TRIS 0xB3FB
435 #define SYS_PORT_H_LAT 0x0000
436 #define SYS_PORT_H_ODC 0x0000
437 #define SYS_PORT_H_CNPU 0x0000
438 #define SYS_PORT_H_CNPD 0x0000
439 #define SYS_PORT_H_CNEN 0x0000
440 #define SYS_PORT_J_ANSEL 0x0000
441 #define SYS_PORT_J_TRIS 0x8B7F
442 #define SYS_PORT_J_LAT 0x0080
443 #define SYS_PORT_J_ODC 0x0000
444 #define SYS_PORT_J_CNPU 0x0000
445 #define SYS_PORT_J_CNPD 0x0000
446 #define SYS_PORT_J_CNEN 0x0800
447 #define SYS_PORT_K_ANSEL 0xFF00
448 #define SYS_PORT_K_TRIS 0xFFFF
449 #define SYS_PORT_K_LAT 0x0000
450 #define SYS_PORT_K_ODC 0x0000
451 #define SYS_PORT_K_CNPU 0x0000
452 #define SYS_PORT_K_CNPD 0x0000
453 #define SYS_PORT_K_CNEN 0x0000
454 /*** Interrupt System Service Configuration ***/
455 #define SYS_INT true
456 /*** Timer System Service Configuration ***/
457 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
458 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
459 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
460 #define SYS_TMR_FREQUENCY 1000
461 #define SYS_TMR_FREQUENCY_TOLERANCE 10
462 #define SYS_TMR_UNIT_RESOLUTION 10000
463 #define SYS_TMR_CLIENT_TOLERANCE 10
464 #define SYS_TMR_INTERRUPT_NOTIFICATION false
465 // *****************************************************************************
466 // *****************************************************************************
467 // Section: Driver Configuration
468 // *****************************************************************************
469 // *****************************************************************************
470 #define DRV_IC_DRIVER_MODE_STATIC
471 #define USE_8BIT_PMP
472 /*** SPI Driver Configuration ***/
473 #define DRV_SPI_NUMBER_OF_MODULES 6
474 /*** Driver Compilation and static configuration options. ***/
475 /*** Select SPI compilation units.***/
476 #define DRV_SPI_POLLED 1
477 #define DRV_SPI_ISR 0
478 #define DRV_SPI_MASTER 1
479 #define DRV_SPI_SLAVE 0
480 #define DRV_SPI_RM 0
481 #define DRV_SPI_EBM 1
482 #define DRV_SPI_8BIT 1
483 #define DRV_SPI_16BIT 1
484 #define DRV_SPI_32BIT 0
485 #define DRV_SPI_DMA 0
486 /*** SPI Driver Static Allocation Options ***/
487 #define DRV_SPI_INSTANCES_NUMBER 3
488 #define DRV_SPI_CLIENTS_NUMBER 3
489 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
490 /* SPI Driver Instance 0 Configuration */
491 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
492 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
493 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
494 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
495 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
496 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
497 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
498 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
499 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
500 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
501 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
502 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
503 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
504 #define DRV_SPI_BAUD_RATE_IDX0 1000000
505 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
506 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
507 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
508 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
509 #define DRV_SPI_QUEUE_SIZE_IDX0 10
510 #define DRV_SPI_RESERVED_JOB_IDX0 1
511 /* SPI Driver Instance 1 Configuration */
512 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
513 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
514 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
515 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
516 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
517 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
518 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
519 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
520 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
521 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
522 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
523 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
524 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
525 #define DRV_SPI_BAUD_RATE_IDX1 1000000
526 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
527 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
528 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
529 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
530 #define DRV_SPI_QUEUE_SIZE_IDX1 10
531 #define DRV_SPI_RESERVED_JOB_IDX1 1
532 /* SPI Driver Instance 2 Configuration */
533 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
534 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
535 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
536 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
537 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
538 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
539 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
540 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
541 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
542 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
543 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
544 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
545 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
546 #define DRV_SPI_BAUD_RATE_IDX2 500000
547 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
548 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
549 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
550 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
551 #define DRV_SPI_QUEUE_SIZE_IDX2 10
552 #define DRV_SPI_RESERVED_JOB_IDX2 1
553 /*** Timer Driver Configuration ***/
554 #define DRV_TMR_INTERRUPT_MODE true
555 /*** Timer Driver 0 Configuration ***/
556 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
557 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
558 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
559 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
560 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
561 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
562 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
563 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
564 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
565 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
566 #define DRV_TMR_POWER_STATE_IDX0
567 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
568 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
569 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
570 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
571 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
572 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
573 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
574 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
575 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
576 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
577 #define DRV_TMR_POWER_STATE_IDX1
578 /*** Timer Driver 2 Configuration ***/
579 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
580 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
581 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
582 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
583 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
584 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
585 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
586 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
587 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
588 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
589 #define DRV_TMR_POWER_STATE_IDX2
590 /*** Timer Driver 3 Configuration ***/
591 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
592 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
593 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
594 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
595 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
596 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
597 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
598 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
599 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
600 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
601 #define DRV_TMR_POWER_STATE_IDX3
602 /*** Timer Driver 4 Configuration ***/
603 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
604 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
605 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
606 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
607 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
608 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
609 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
610 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
611 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
612 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
613 #define DRV_TMR_POWER_STATE_IDX4
614  // *****************************************************************************
615 /* USART Driver Configuration Options
616 */
617 #define DRV_USART_INSTANCES_NUMBER 1
618 #define DRV_USART_CLIENTS_NUMBER 1
619 #define DRV_USART_INTERRUPT_MODE false
620 #define DRV_USART_BYTE_MODEL_SUPPORT true
621 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
622 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
623 // *****************************************************************************
624 // *****************************************************************************
625 // Section: Middleware & Other Library Configuration
626 // *****************************************************************************
627 // *****************************************************************************
628 /*** USB Driver Configuration ***/
629 /* Enables Device Support */
630 #define DRV_USBHS_DEVICE_SUPPORT true
631 /* Disable Host Support */
632 #define DRV_USBHS_HOST_SUPPORT false
633 /* Maximum USB driver instances */
634 #define DRV_USBHS_INSTANCES_NUMBER 1
635 /* Interrupt mode enabled */
636 #define DRV_USBHS_INTERRUPT_MODE true
637 /* Number of Endpoints used */
638 #define DRV_USBHS_ENDPOINTS_NUMBER 2
639 /*** USB Device Stack Configuration ***/
640 /* The USB Device Layer will not initialize the USB Driver */
641 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
642 /* Maximum device layer instances */
643 #define USB_DEVICE_INSTANCES_NUMBER 1
644 /* EP0 size in bytes */
645 #define USB_DEVICE_EP0_BUFFER_SIZE 64
646 /* Endpoint Transfer Queue Size combined for Read and write */
647 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
648 // *****************************************************************************
649 // *****************************************************************************
650 // Section: Application Configuration
651 // *****************************************************************************
652 // *****************************************************************************
653 /*** Application Defined Pins ***/
654 /*** Functions for LED1 pin ***/
655 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
656 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
657 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
658 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
659 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
660 /*** Functions for LED2 pin ***/
661 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
662 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
663 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
664 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
665 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
666 /*** Functions for DMP_FIRE_LED pin ***/
667 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
668 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
669 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
670 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
671 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
672 /*** Functions for HVPS_ENB pin ***/
673 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
674 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
675 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
676 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
677 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
678 /*** Functions for RLY_HVPS_OUT pin ***/
679 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
680 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
681 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
682 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
683 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
684 /*** Functions for RLY_WL_SPS_POL pin ***/
685 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
686 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
687 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
688 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
689 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
690 /*** Functions for RLY_LOG pin ***/
691 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
692 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
693 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
694 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
695 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
696 /*** Functions for RLY_DMP_FIRE pin ***/
697 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
698 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
699 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
700 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
701 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
702 /*** Functions for RLY_AUX pin ***/
703 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
704 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
705 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
706 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
707 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
708 /*** Functions for RLY_CCL pin ***/
709 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
710 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
711 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
712 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
713 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
714 /*** Functions for RLY_WL_MON pin ***/
715 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
716 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
717 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
718 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
719 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
720 /*** Functions for RLY_ARMCF pin ***/
721 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
722 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
723 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
724 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
725 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
726 /*** Functions for RLY_ARM pin ***/
727 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
728 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
729 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
730 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
731 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
732 /*** Functions for TPAN1 pin ***/
733 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
734 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
735 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
736 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
737 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
738 /*** Functions for TPAN2 pin ***/
739 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
740 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
741 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
742 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
743 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
744 /*** Functions for FSK_DAC_CS pin ***/
745 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
746 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
747 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
748 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
749 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
750 /*** Functions for RLY_COMM pin ***/
751 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
752 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
753 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
754 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
755 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
756 /*** Functions for FSK_DAC_CLR pin ***/
757 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
758 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
759 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
760 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
761 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
762 /*** Functions for WL_CPS_SW pin ***/
763 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
764 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
765 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
766 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
767 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
768 /*** Functions for HVPS_SW pin ***/
769 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
770 /*** Functions for MAN_SIG pin ***/
771 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
772 /*** Functions for DMP_FIRE_SW pin ***/
773 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
774 /*** Functions for NEG_SW pin ***/
775 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
776 /*** Functions for POS_SW pin ***/
777 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
778 /*** Functions for DRUM1_SW pin ***/
779 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
780 /*** Functions for SAFE_SW pin ***/
781 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
782 /*** Functions for DRUM2_SW pin ***/
783 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
784 /*** Functions for LOG_SW pin ***/
785 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
786 /*** Functions for AUX_SW pin ***/
787 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
788 /*** Functions for ARMCF_SW pin ***/
789 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
790 /*** Functions for ARM_SW pin ***/
791 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
792 /*** Functions for ARMCF_AUTO_SW pin ***/
793 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
794 /*** Functions for FIRE_SW_OFF pin ***/
795 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
796 /*** Functions for FIRE_SW_ON pin ***/
797 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
798 /*** Functions for WL_SPS_POS_DET pin ***/
799 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
800 /*** Functions for WL_SPS_NEG_DET pin ***/
801 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
802 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
803 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
804 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
805 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
806 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
807 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
808 /*** Application Instance 0 Configuration ***/
809 //DOM-IGNORE-BEGIN
810 //DOM-IGNORE-END
811  // _SYSTEM_CONFIG_H
812 /*******************************************************************************
813  End of File
814 */
815 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
816 /* CLOSE_FILE Include File */
817 
818 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
819 /*******************************************************************************
820  Driver Common Header Definitions
821  Company:
822  Microchip Technology Inc.
823  File Name:
824  drv_common.h
825  Summary:
826  This file defines the common macros and definitions used by the driver
827  definition and implementation headers.
828  Description:
829  This file defines the common macros and definitions used by the driver
830  definition and the implementation header.
831  Remarks:
832  The directory in which this file resides should be added to the compiler's
833  search path for header files.
834  *******************************************************************************/
835 //DOM-IGNORE-BEGIN
836 /*******************************************************************************
837 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
838 Microchip licenses to you the right to use, modify, copy and distribute
839 Software only when embedded on a Microchip microcontroller or digital signal
840 controller that is integrated into your product or third party product
841 (pursuant to the sublicense terms in the accompanying license agreement).
842 You should refer to the license agreement accompanying this Software for
843 additional information regarding your rights and obligations.
844 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
845 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
846 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
847 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
848 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
849 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
850 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
851 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
852 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
853 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
854  *******************************************************************************/
855 //DOM-IGNORE-END
856 #ifndef _DRV_COMMON_H
857 #define _DRV_COMMON_H
858 #include <stdint.h>
859 #include <stddef.h>
860 // *****************************************************************************
861 /* Device Driver I/O Intent
862  Summary:
863  Identifies the intended usage of the device when it is opened.
864  Description:
865  This enumeration identifies the intended usage of the device when the
866  caller opens the device. It identifies the desired behavior of the device
867  driver for the following:
868  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
869  block until the operation is finished or do they return immediately and
870  require the caller to call another routine to check the status of the
871  operation)
872  * Support reading and/or writing of data from/to the device
873  * Identify the buffering behavior (sometimes called "double buffering" of
874  the driver. Indicates if the driver should maintain its own read/write
875  buffers and copy data to/from these buffers to/from the caller's buffers.
876  * Identify the DMA behavior of the peripheral
877  Remarks:
878  The buffer allocation method is not identified by this enumeration. Buffers
879  can be allocated statically at build time, dynamically at run-time, or
880  even allocated by the caller and passed to the driver for its own usage if
881  a driver-specific routine is provided for such. This choice is left to
882  the design of the individual driver and is considered part of its
883  interface.
884  These values can be considered "flags". One selection from each of the
885  groups below can be ORed together to create the complete value passed
886  to the driver's open routine.
887 */
888 
889 typedef
890  enum
891  {
892  /* Read */
893  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
894  = 1 << 0 /* DOM-IGNORE-END*/
895  ,
896  /* Write */
897  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
898  = 1 << 1 /* DOM-IGNORE-END*/
899  ,
900  /* Read and Write*/
901  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
902  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
903  ,
904  /* The driver will block and will return when the operation is complete */
905  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
906  = 0 << 2 /* DOM-IGNORE-END*/
907  ,
908  /* The driver will return immediately */
909  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
910  = 1 << 2 /* DOM-IGNORE-END*/
911  ,
912  /* The driver will support only one client at a time */
913  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
914  = 1 << 3 /* DOM-IGNORE-END*/
915  ,
916  /* The driver will support multiple clients at a time */
917  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
918  = 0 << 3 /* DOM-IGNORE-END*/
919  } DRV_IO_INTENT ;
920 // *****************************************************************************
921 /* Driver Client Status
922  Summary:
923  Identifies the current status/state of a client's connection to a driver.
924  Description:
925  This enumeration identifies the current status/state of a client's link to
926  a driver.
927  Remarks:
928  The enumeration used as the return type for the client-level status routines
929  defined by each device driver or system module (for example,
930  DRV_USART_ClientStatus) must be based on the values in this enumeration.
931 */
932 
933 typedef
934  enum
935  {
936  /* Indicates that a driver-specific error has occurred. */
938  /* An unspecified error has occurred.*/
940  /* The driver is closed, no operations for this client are ongoing,
941  and/or the given handle is invalid. */
943  /* The driver is currently busy and cannot start additional operations. */
945  /* The module is running and ready for additional operations */
947  /* Indicates that the module is in a driver-specific ready/run state. */
950 // *****************************************************************************
951 /* Device Driver Blocking Status Macro
952  Summary:
953  Returns if the I/O intent provided is blocking
954  Description:
955  This macro returns if the I/O intent provided is blocking.
956  Remarks:
957  None.
958 */
959 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
960 // *****************************************************************************
961 /* Device Driver Non Blocking Status Macro
962  Summary:
963  Returns if the I/O intent provided is non-blocking.
964  Description:
965  This macro returns if the I/ intent provided is non-blocking.
966  Remarks:
967  None.
968 */
969 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
970 // *****************************************************************************
971 /* Device Driver Exclusive Status Macro
972  Summary:
973  Returns if the I/O intent provided is non-blocking.
974  Description:
975  This macro returns if the I/O intent provided is non-blocking.
976  Remarks:
977  None.
978 */
979 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
980 // *****************************************************************************
981 /* Device Driver IO Buffer Identifier
982  Summary:
983  Identifies to which buffer a device operation will apply.
984  Description:
985  This enumeration identifies to which buffer (read, write, both, or neither)
986  a device operation will apply. This is used for "flush" (or similar)
987  operations.
988 */
989 
990 typedef
991  enum
992  {
993  // Operation does not apply to any buffer
995  // Operation applies to read buffer
997  // Operation applies to write buffer
999  // Operation applies to both read and write buffers
1002 // *****************************************************************************
1003 /* Device Handle
1004  Summary:
1005  Handle to an opened device driver.
1006  Description:
1007  This handle identifies the open instance of a device driver. It must be
1008  passed to all other driver routines (except the initialization, deinitialization,
1009  or power routines) to identify the caller.
1010  Remarks:
1011  Every application or module that wants to use a driver must first call
1012  the driver's open routine. This is the only routine that is absolutely
1013  required for every driver.
1014  If a driver is unable to allow an additional module to use it, it must then
1015  return the special value DRV_HANDLE_INVALID. Callers should check the
1016  handle returned for this value to ensure this value was not returned before
1017  attempting to call any other driver routines using the handle.
1018 */
1019 
1020 typedef
1021 uintptr_t
1023 // *****************************************************************************
1024 /* Invalid Device Handle
1025  Summary:
1026  Invalid device handle.
1027  Description:
1028  If a driver is unable to allow an additional module to use it, it must then
1029  return the special value DRV_HANDLE_INVALID. Callers should check the
1030  handle returned for this value to ensure this value was not returned before
1031  attempting to call any other driver routines using the handle.
1032  Remarks:
1033  None.
1034 */
1035 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1036 // *****************************************************************************
1037 /* Not supported configuration
1038  Summary:
1039  Not supported configuration.
1040  Description:
1041  If the configuration option is not supported on an instance of the
1042  peripheral, use this macro to equate to that configuration. This option
1043  should be listed as a possible value in the description of that
1044  configuration option.
1045 */
1046 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1047 // *****************************************************************************
1048 /* Unsupported Attribute Abstraction
1049  Summary:
1050  Abstracts the use of the unsupported attribute defined by the compiler.
1051  Description:
1052  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1053  compilation of the drivers for all different variants.
1054  Example:
1055  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1056  This function will not generate a compiler error if the interface is not
1057  defined for the selected device.
1058  Remarks:
1059  None.
1060 */
1061 #define _PLIB_UNSUPPORTED
1062  //_DRV_COMMON_H
1063 /*******************************************************************************
1064  End of File
1065 */
1066 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1067 /* CLOSE_FILE Include File */
1068 
1069 #include "system/common/sys_module.h"
1070 // *****************************************************************************
1071 /* IC Driver Module Index Numbers
1072  Summary:
1073  IC driver index definitions.
1074  Description:
1075  These constants provide IC Driver index definitions.
1076  Remarks:
1077  These constants should be used in place of hard-coded numeric literals.
1078  These values should be passed into the DRV_IC_Initialize and
1079  DRV_IC_Open routines to identify the driver instance in use.
1080 */
1081 #define DRV_IC_INDEX_0 0
1082 #define DRV_IC_INDEX_1 1
1083 #define DRV_IC_INDEX_2 2
1084 #define DRV_IC_INDEX_3 3
1085 #define DRV_IC_INDEX_4 4
1086 #define DRV_IC_INDEX_5 5
1087 #define DRV_IC_INDEX_6 6
1088 #define DRV_IC_INDEX_7 7
1089 #define DRV_IC_INDEX_8 8
1090 #define DRV_IC_INDEX_9 9
1091 #define DRV_IC_INDEX_10 10
1092 #define DRV_IC_INDEX_11 11
1093 #define DRV_IC_INDEX_12 12
1094 #define DRV_IC_INDEX_13 13
1095 #define DRV_IC_INDEX_14 14
1096 #define DRV_IC_INDEX_15 15
1097 // *****************************************************************************
1098 // *****************************************************************************
1099 // Section: Interface Headers for the static driver
1100 // *****************************************************************************
1101 // *****************************************************************************
1102 // *****************************************************************************
1103 /* Function:
1104  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1105  const SYS_MODULE_INIT * const init);
1106  Summary:
1107  Initializes the Input Capture instance for the specified driver index.
1108  <p><b>Implementation:</b> Static</p>
1109  Description:
1110  This routine initializes the Input Capture driver instance for the specified
1111  driver instance, making it ready for clients to use it. The initialization
1112  routine is specified by the MHC parameters. The driver instance index is
1113  independent of the Input Capture module ID. For example, driver instance 0
1114  can be assigned to Input Capture 2.
1115  Precondition:
1116  None.
1117  Parameters:
1118  None.
1119  Returns:
1120  None.
1121  Remarks:
1122  This routine must be called before any other Input Capture routine is called.
1123  This routine should only be called once during system initialization.
1124 */
1125 
1126 SYS_MODULE_OBJ
1128  const SYS_MODULE_INDEX index ,
1129  const SYS_MODULE_INIT * const init ) ;
1130 // *****************************************************************************
1131 /* Function:
1132 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1133  Summary:
1134  Opens the Input Capture instance for the specified driver index.
1135  <p><b>Implementation:</b> Static</p>
1136  Description:
1137  This routine starts the Input Capture driver for the specified driver
1138  index, starting an input capture.
1139  Precondition:
1140  DRV_IC_Initialize has been called.
1141  Parameters:
1142  None.
1143  Returns:
1144  None.
1145  Remarks:
1146  None.
1147 */
1148 
1149 DRV_HANDLE
1150  DRV_IC_Open (
1151  const SYS_MODULE_INDEX drvIndex ,
1152  const DRV_IO_INTENT intent ) ;
1153 // *****************************************************************************
1154 /* Function:
1155  void DRV_IC_Close(DRV_HANDLE handle)
1156  Summary:
1157  Closes the Input Capture instance for the specified driver index.
1158  <p><b>Implementation:</b> Static</p>
1159  Description:
1160  This routine stops the Input Capture driver for the specified driver
1161  index, stopping an input capture.
1162  Precondition:
1163  DRV_IC_Initialize has been called.
1164  Parameters:
1165  None.
1166  Returns:
1167  None.
1168  Remarks:
1169  None.
1170 */
1171 
1172 void
1173  DRV_IC_Close (
1174  DRV_HANDLE handle ) ;
1175 // *****************************************************************************
1176 /* Function:
1177 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1178  Summary:
1179  Starts the Input Capture instance for the specified driver index.
1180  <p><b>Implementation:</b> Static</p>
1181  Description:
1182  This routine starts the Input Capture driver for the specified driver
1183  index, starting an input capture.
1184  Precondition:
1185  DRV_IC_Initialize has been called.
1186  Parameters:
1187  None.
1188  Returns:
1189  None.
1190  Remarks:
1191  None.
1192 */
1193 
1194 DRV_HANDLE
1195  DRV_IC_Start (
1196  const SYS_MODULE_INDEX drvIndex ,
1197  const DRV_IO_INTENT intent ) ;
1198 // *****************************************************************************
1199 /* Function:
1200  void DRV_IC_Stop(DRV_HANDLE handle)
1201  Summary:
1202  Stops the Input Capture instance for the specified driver index.
1203  <p><b>Implementation:</b> Static</p>
1204  Description:
1205  This routine stops the Input Capture driver for the specified driver
1206  index, stopping an input capture.
1207  Precondition:
1208  DRV_IC_Initialize has been called.
1209  Parameters:
1210  None.
1211  Returns:
1212  None.
1213  Remarks:
1214  None.
1215 */
1216 
1217 void
1218  DRV_IC_Stop (
1219  DRV_HANDLE handle ) ;
1220 // *****************************************************************************
1221 /* Function:
1222  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1223  Summary:
1224  Reads the 32-bit Input Capture for the specified driver index.
1225  <p><b>Implementation:</b> Static</p>
1226  Description:
1227  This routine reads the 32-bit data for the specified driver index
1228  Precondition:
1229  DRV_IC_Initialize has been called.
1230  Parameters:
1231  None.
1232  Returns:
1233  uint32_t value of the data read from the Input Capture.
1234  Remarks:
1235  None.
1236 */
1237 
1238 uint32_t
1240  DRV_HANDLE handle ) ;
1241 // *****************************************************************************
1242 /* Function:
1243  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1244  Summary:
1245  Reads the 16-bit Input Capture for the specified driver index.
1246  <p><b>Implementation:</b> Static</p>
1247  Description:
1248  This routine reads the 16-bit data for the specified driver index.
1249  Precondition:
1250  DRV_IC_Initialize has been called.
1251  Parameters:
1252  None.
1253  Returns:
1254  uint16_t value of the data read from the Input Capture.
1255  Remarks:
1256  None.
1257 */
1258 
1259 uint16_t
1261  DRV_HANDLE handle ) ;
1262 // *****************************************************************************
1263 /* Function:
1264  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1265  Summary:
1266  Returns the Input Capture instance buffer empty status for the specified driver
1267  index.
1268  <p><b>Implementation:</b> Static</p>
1269  Description:
1270  Returns the Input Capture instance buffer empty status for the specified driver
1271  index. The function should be called to determine whether or not the IC buffer
1272  has data.
1273  Precondition:
1274  DRV_IC_Initialize has been called.
1275  Parameters:
1276  None.
1277  Returns:
1278  Boolean
1279  - 1 - Buffer is empty
1280  - 0 - Buffer is not empty
1281  Remarks:
1282  None.
1283 */
1284 
1285 bool
1287  DRV_HANDLE handle ) ;
1288 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1289 /*******************************************************************************
1290  IC Driver Interface Declarations for Static Single Instance Driver
1291  Company:
1292  Microchip Technology Inc.
1293  File Name:
1294  drv_ic_static.h
1295  Summary:
1296  IC driver interface declarations for the static single instance driver.
1297  Description:
1298  The IC device driver provides a simple interface to manage the IC
1299  modules on Microchip microcontrollers. This file defines the interface
1300  Declarations for the IC driver.
1301 
1302  Remarks:
1303  Static interfaces incorporate the driver instance number within the names
1304  of the routines, eliminating the need for an object ID or object handle.
1305 
1306  Static single-open interfaces also eliminate the need for the open handle.
1307 *******************************************************************************/
1308 //DOM-IGNORE-BEGIN
1309 /*******************************************************************************
1310 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1311 Microchip licenses to you the right to use, modify, copy and distribute
1312 Software only when embedded on a Microchip microcontroller or digital signal
1313 controller that is integrated into your product or third party product
1314 (pursuant to the sublicense terms in the accompanying license agreement).
1315 You should refer to the license agreement accompanying this Software for
1316 additional information regarding your rights and obligations.
1317 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1318 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1319 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1320 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1321 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1322 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1323 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1324 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1325 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1326 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1327 *******************************************************************************/
1328 //DOM-IGNORE-END
1329 #ifndef _DRV_IC_STATIC_H
1330 #define _DRV_IC_STATIC_H
1331 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1332 #define DRV_IC_Close( handle )
1333 // *****************************************************************************
1334 // *****************************************************************************
1335 // Section: Interface Headers for Instance 0 for the static driver
1336 // *****************************************************************************
1337 // *****************************************************************************
1338 
1339 void
1340  DRV_IC0_Initialize ( void ) ;
1341 
1342 void
1343  DRV_IC0_Start ( void ) ;
1344 
1345 void
1346  DRV_IC0_Stop ( void ) ;
1347 
1348 uint32_t
1349  DRV_IC0_Capture32BitDataRead ( void ) ;
1350 
1351 uint16_t
1352  DRV_IC0_Capture16BitDataRead ( void ) ;
1353 
1354 bool
1355  DRV_IC0_BufferIsEmpty ( void ) ;
1356  // #ifndef _DRV_IC_STATIC_H
1357 /*******************************************************************************
1358  End of File
1359 */
1360 
1361 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1362 /* CLOSE_FILE Include File */
1363 
1364  // #ifndef _DRV_IC_H
1365 /*******************************************************************************
1366  End of File
1367 */
1368 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1369 /* CLOSE_FILE Include File */
1370 
1371 #include "system/devcon/sys_devcon.h"
1372 #include "system/clk/sys_clk.h"
1373 #include "system/int/sys_int.h"
1374 #include "system/tmr/sys_tmr.h"
1375 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1376 /*******************************************************************************
1377  ADC Driver Interface Declarations for Static Single Instance Driver
1378  Company:
1379  Microchip Technology Inc.
1380  File Name:
1381  drv_adc_static.h
1382  Summary:
1383  ADC driver interface declarations for the static single instance driver.
1384  Description:
1385  The ADC device driver provides a simple interface to manage the ADC
1386  modules on Microchip microcontrollers. This file defines the interface
1387  Declarations for the ADC driver.
1388 
1389  Remarks:
1390  Static interfaces incorporate the driver instance number within the names
1391  of the routines, eliminating the need for an object ID or object handle.
1392 
1393  Static single-open interfaces also eliminate the need for the open handle.
1394 *******************************************************************************/
1395 //DOM-IGNORE-BEGIN
1396 /*******************************************************************************
1397 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1398 Microchip licenses to you the right to use, modify, copy and distribute
1399 Software only when embedded on a Microchip microcontroller or digital signal
1400 controller that is integrated into your product or third party product
1401 (pursuant to the sublicense terms in the accompanying license agreement).
1402 You should refer to the license agreement accompanying this Software for
1403 additional information regarding your rights and obligations.
1404 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1405 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1406 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1407 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1408 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1409 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1410 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1411 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1412 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1413 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1414 *******************************************************************************/
1415 //DOM-IGNORE-END
1416 #ifndef _DRV_ADC_STATIC_H
1417 #define _DRV_ADC_STATIC_H
1418 #include <stdbool.h>
1419 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1420 #include "peripheral/adchs/plib_adchs.h"
1421 #include "peripheral/int/plib_int.h"
1422 
1423 typedef
1424  enum
1425  {
1426  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1428  } DRV_ADC_MODULE_ID ;
1429 // *****************************************************************************
1430 // *****************************************************************************
1431 // Section: Interface Headers for ADC Static Driver
1432 // *****************************************************************************
1433 // *****************************************************************************
1434 
1435 void
1436  DRV_ADC_Initialize ( void ) ;
1437 
1438 inline void
1439  DRV_ADC_DeInitialize ( void ) ;
1440 
1441 inline void
1442  DRV_ADC0_Open ( void ) ;
1443 
1444 inline void
1445  DRV_ADC0_Close ( void ) ;
1446 
1447 inline void
1448  DRV_ADC1_Open ( void ) ;
1449 
1450 inline void
1451  DRV_ADC1_Close ( void ) ;
1452 
1453 inline void
1454  DRV_ADC_Start ( void ) ;
1455 
1456 inline void
1457  DRV_ADC_Stop ( void ) ;
1458 
1459 uint32_t
1461  uint8_t bufIndex ) ;
1462 
1463 bool
1465  uint8_t bufIndex ) ;
1466  // #ifndef _DRV_ADC_STATIC_H
1467 /*******************************************************************************
1468  End of File
1469 */
1470 
1471 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1472 /* CLOSE_FILE Include File */
1473 
1474 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1475 /*******************************************************************************
1476  Timer Driver Interface Declarations for Static Single Instance Driver
1477  Company:
1478  Microchip Technology Inc.
1479  File Name:
1480  drv_tmr_static.h
1481  Summary:
1482  Timer driver interface declarations for the static single instance driver.
1483  Description:
1484  The Timer device driver provides a simple interface to manage the Timer
1485  modules on Microchip microcontrollers. This file defines the interface
1486  Declarations for the TMR driver.
1487 
1488  Remarks:
1489  Static interfaces incorporate the driver instance number within the names
1490  of the routines, eliminating the need for an object ID or object handle.
1491 
1492  Static single-open interfaces also eliminate the need for the open handle.
1493 *******************************************************************************/
1494 //DOM-IGNORE-BEGIN
1495 /*******************************************************************************
1496 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1497 Microchip licenses to you the right to use, modify, copy and distribute
1498 Software only when embedded on a Microchip microcontroller or digital signal
1499 controller that is integrated into your product or third party product
1500 (pursuant to the sublicense terms in the accompanying license agreement).
1501 You should refer to the license agreement accompanying this Software for
1502 additional information regarding your rights and obligations.
1503 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1504 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1505 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1506 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1507 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1508 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1509 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1510 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1511 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1512 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1513 *******************************************************************************/
1514 //DOM-IGNORE-END
1515 #ifndef _DRV_TMR_STATIC_H
1516 #define _DRV_TMR_STATIC_H
1517 // *****************************************************************************
1518 // *****************************************************************************
1519 // Section: Include Headers
1520 // *****************************************************************************
1521 // *****************************************************************************
1522 #include <stdint.h>
1523 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1524 /*******************************************************************************
1525  Timer Device Driver Interface Definition
1526  Company:
1527  Microchip Technology Inc.
1528  File Name:
1529  drv_tmr.h
1530  Summary:
1531  Timer device driver interface header file.
1532  Description:
1533  This header file contains the function prototypes and definitions of the
1534  data types and constants that make up the interface to the Timer device
1535  driver.
1536 *******************************************************************************/
1537 //DOM-IGNORE-BEGIN
1538 /*******************************************************************************
1539 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1540 Microchip licenses to you the right to use, modify, copy and distribute
1541 Software only when embedded on a Microchip microcontroller or digital signal
1542 controller that is integrated into your product or third party product
1543 (pursuant to the sublicense terms in the accompanying license agreement).
1544 You should refer to the license agreement accompanying this Software for
1545 additional information regarding your rights and obligations.
1546 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1547 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1548 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1549 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1550 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1551 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1552 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1553 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1554 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1555 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1556 *******************************************************************************/
1557 //DOM-IGNORE-END
1558 #ifndef _DRV_TMR_H
1559 #define _DRV_TMR_H
1560 // *****************************************************************************
1561 // *****************************************************************************
1562 // Section: File includes
1563 // *****************************************************************************
1564 // *****************************************************************************
1565 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1566 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
1567 #include "peripheral/tmr/plib_tmr.h"
1568 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
1569 /*******************************************************************************
1570  Timer Device Driver Interface Definition
1571  Company:
1572  Microchip Technology Inc.
1573  File Name:
1574  tmr_definitions_pic32m.h
1575  Summary:
1576  Timer device driver definitions header file.
1577  Description:
1578  This header file contains the definitions of the
1579  data types and constants that make up the interface to the Timer device
1580  driver.
1581 *******************************************************************************/
1582 //DOM-IGNORE-BEGIN
1583 /*******************************************************************************
1584 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1585 Microchip licenses to you the right to use, modify, copy and distribute
1586 Software only when embedded on a Microchip microcontroller or digital signal
1587 controller that is integrated into your product or third party product
1588 (pursuant to the sublicense terms in the accompanying license agreement).
1589 You should refer to the license agreement accompanying this Software for
1590 additional information regarding your rights and obligations.
1591 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1592 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1593 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1594 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1595 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1596 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1597 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1598 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1599 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1600 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1601 *******************************************************************************/
1602 //DOM-IGNORE-END
1603 #ifndef _TMR_DEFINITIONS_PIC32M_H
1604 #define _TMR_DEFINITIONS_PIC32M_H
1605 // DOM-IGNORE-BEGIN
1606 // DOM-IGNORE-END
1607 
1608 typedef
1609  enum
1610  {
1611  /* Clock input to the timer module is internal(Peripheral Clock) */
1613  /*DOM-IGNORE-BEGIN*/
1614  = 0x00 /*DOM-IGNORE-END*/
1615  ,
1616  /* Clock input to the timer module is from T1CK pin (external)
1617  with clock synchronization enabled */
1619  /*DOM-IGNORE-BEGIN*/
1620  = 0x01 /*DOM-IGNORE-END*/
1621  ,
1622  /* Clock input to the timer module is from T1CK pin (external)
1623  with clock synchronization disabled */
1625  /*DOM-IGNORE-BEGIN*/
1626  = 0x11 /*DOM-IGNORE-END*/
1627  ,
1628  /* Clock input to the timer module is from secondary oscillator (external)
1629  with clock synchronization enabled */
1631  /*DOM-IGNORE-BEGIN*/
1632  = 0x02 /*DOM-IGNORE-END*/
1633  ,
1634  /* Clock input to the timer module is from secondary oscillator (external)
1635  with clock synchronization disabled */
1637  /*DOM-IGNORE-BEGIN*/
1638  = 0x12 /*DOM-IGNORE-END*/
1639  ,
1640  /* Clock input to the timer module is from LPRC
1641  with clock synchronization enabled */
1643  /*DOM-IGNORE-BEGIN*/
1644  = 0x03 /*DOM-IGNORE-END*/
1645  ,
1646  /* Clock input to the timer module is from LPRC
1647  with clock synchronization disabled */
1649  /*DOM-IGNORE-BEGIN*/
1650  = 0x13 /*DOM-IGNORE-END*/
1652 //DOM-IGNORE-BEGIN
1653 //DOM-IGNORE-END
1654  // #ifndef _DRV_TMR_H
1655 /*******************************************************************************
1656  End of File
1657 */
1658 
1659 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
1660 /* CLOSE_FILE Include File */
1661 
1662 #include "system/int/sys_int.h" // System Interrupt Definitions
1663 #include "system/clk/sys_clk.h"
1664 // DOM-IGNORE-BEGIN
1665 // DOM-IGNORE-END
1666 // *****************************************************************************
1667 // *****************************************************************************
1668 // Section: TMR Driver Data Types
1669 // *****************************************************************************
1670 // *****************************************************************************
1671 // *****************************************************************************
1672 /* Timer Driver Module Index Numbers
1673  Summary:
1674  Timer driver index definitions
1675  Description:
1676  These constants provide Timer driver index definitions.
1677  Remarks:
1678  These constants should be used in place of hard-coded numeric literals.
1679  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
1680  functions to identify the driver instance in use.
1681 */
1682 #define DRV_TMR_INDEX_0 0
1683 #define DRV_TMR_INDEX_1 1
1684 #define DRV_TMR_INDEX_2 2
1685 #define DRV_TMR_INDEX_3 3
1686 #define DRV_TMR_INDEX_4 4
1687 #define DRV_TMR_INDEX_5 5
1688 #define DRV_TMR_INDEX_6 6
1689 #define DRV_TMR_INDEX_7 7
1690 #define DRV_TMR_INDEX_8 8
1691 #define DRV_TMR_INDEX_9 9
1692 #define DRV_TMR_INDEX_10 10
1693 #define DRV_TMR_INDEX_11 11
1694 // *****************************************************************************
1695 /* Timer Driver Module Index Count
1696  Summary:
1697  Number of valid Timer driver indices.
1698  Description:
1699  This constant identifies Timer driver index definitions.
1700  Remarks:
1701  This constant should be used in place of hard-coded numeric literals.
1702  This value is device-specific.
1703 */
1704 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
1705 // *****************************************************************************
1706 /* Timer Driver Client Status
1707  Summary:
1708  Identifies the client-specific status of the Timer driver
1709  Description:
1710  This enumeration identifies the client-specific status of the Timer driver.
1711  Remarks:
1712  None.
1713 */
1714 
1715 typedef
1716  enum
1717  {
1718  /* Driver is invalid (or unopened) state */
1720  /*DOM-IGNORE-BEGIN*/
1721  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
1722  ,
1723  /* An operation is currently in progress */
1725  /*DOM-IGNORE-BEGIN*/
1726  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
1727  ,
1728  /* Ready, no operations running */
1730  /*DOM-IGNORE-BEGIN*/
1731  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
1732  ,
1733  /* Timer started and running, processing transactions */
1735  /*DOM-IGNORE-BEGIN*/
1736  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
1738 // *****************************************************************************
1739 /* Timer Driver Clock sources
1740  Summary:
1741  Lists the clock sources available for timer driver.
1742  Description:
1743  This enumeration lists all the available clock sources for the timer
1744  hardware.
1745  Remarks:
1746  Not all modes are available on all devices.
1747  'Synchronization' may not be applicable for all the instances of the timer.
1748  The driver discards the Synchronization mode selected if it is not
1749  applicable for the selected hardware.
1750 */
1751 // *****************************************************************************
1752 /* Timer Driver Operation mode
1753  Summary:
1754  Lists the operation modes available for timer driver.
1755  Description:
1756  This enumeration lists all the available operation modes that are valid for
1757  the timer hardware.
1758  Remarks:
1759  Not all modes are available on all devices.
1760 */
1761 
1762 typedef
1763  enum
1764  {
1765  /* The timer module operating mode none/invalid */
1767  /* The timer module operates in 16 bit mode */
1769  /* The timer module operates in 32 bit mode */
1770  /* This will combine two 16 bit timer modules */
1773 // *****************************************************************************
1774 /* Timer Driver divider operating specification
1775  Summary:
1776  This data structure specifies the divider values that can be obtained by the
1777  timer module.
1778  Description:
1779  This data structure specifies the divider values that can be obtained by the
1780  timer hardware.
1781  Remarks:
1782  None.
1783 */
1784 
1785 typedef
1786  struct
1787  {
1788  /* The minimum divider value that the timer module can obtain */
1789  uint32_t dividerMin ;
1790  /* The maximum divider value that the timer module can obtain */
1791  uint32_t dividerMax ;
1792  /* The divider step value, between 2 divider values */
1793  /* Should be 1 for most timers */
1794  uint32_t dividerStep ;
1796 // *****************************************************************************
1797 /* Timer Driver Initialize Data
1798  Summary:
1799  Defines the Timer driver initialization data.
1800  Description:
1801  This data type defines data required to initialize the Timer driver.
1802  Remarks:
1803  Not all initialization features are available on all devices.
1804 */
1805 
1806 typedef
1807  struct
1808  {
1809  /* System module initialization. */
1810  SYS_MODULE_INIT moduleInit ;
1811  /* Identifies timer hardware module (PLIB-level) ID */
1812  TMR_MODULE_ID tmrId ;
1813  /* Clock Source select. */
1814  DRV_TMR_CLK_SOURCES clockSource ;
1815  /* Prescaler Selection from the processor enumeration */
1816  TMR_PRESCALE prescale ;
1817  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
1818  is selected the interrupt will be generated by the 2nd timer of the pair,
1819  the odd numbered one. */
1820  INT_SOURCE interruptSource ;
1821  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
1822  timer modules to form a 32 bit one. This is usually only necessary for
1823  very long delays. */
1824  DRV_TMR_OPERATION_MODE mode ;
1825  /* Asynchronous write enable configuration. If true the asynchronous write
1826  is enabled. For timers that do not support this feature the value is
1827  ignored */
1828  bool asyncWriteEnable ;
1829  } DRV_TMR_INIT ;
1830 // *****************************************************************************
1831 /* Timer Driver Callback Function Pointer
1832  Summary:
1833  Pointer to a Timer driver callback function data type.
1834  Description:
1835  This data type defines a pointer to a Timer driver callback function.
1836  Remarks:
1837  Useful only when timer alarm callback support is enabled by defining the
1838  DRV_TMR_ALARM_ENABLE configuration option.
1839 */
1840 
1841 typedef
1842 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
1843 uint32_t alarmCount ) ;
1844 // *****************************************************************************
1845 // *****************************************************************************
1846 // Section: Timer Driver Module Interface Functions
1847 // *****************************************************************************
1848 // *****************************************************************************
1849 // *****************************************************************************
1850 /* Function:
1851  SYS_MODULE_OBJ DRV_TMR_Initialize
1852  (
1853  const SYS_MODULE_INDEX drvIndex,
1854  const SYS_MODULE_INIT * const init
1855  )
1856  Summary:
1857  Initializes the Timer driver.
1858  <p><b>Implementation:</b> Static/Dynamic</p>
1859  Description:
1860  This function initializes the Timer driver, making it ready for clients to
1861  open and use it.
1862  Precondition:
1863  None.
1864  Parameters:
1865  drvIndex - Index for the driver instance to be initialized
1866  init - Pointer to a data structure containing any data necessary
1867  to initialize the driver.
1868  Returns:
1869  If successful, returns a valid handle to a driver object. Otherwise, it
1870  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
1871  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
1872  Example:
1873  <code>
1874  DRV_TMR_INIT init;
1875  SYS_MODULE_OBJ objectHandle;
1876  // Populate the timer initialization structure
1877  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
1878  init.tmrId = TMR_ID_2;
1879  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
1880  init.prescale = TMR_PRESCALE_VALUE_256;
1881  init.interruptSource = INT_SOURCE_TIMER_2;
1882  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
1883  init.asyncWriteEnable = false;
1884  // Do something
1885  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
1886  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
1887  {
1888  // Handle error
1889  }
1890  </code>
1891  Remarks:
1892  This function must be called before any other Timer driver function is
1893  called.
1894  This function should only be called once during system initialization unless
1895  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
1896  This function will NEVER block for hardware access. The system must use
1897  DRV_TMR_Status to find out when the driver is in the ready state.
1898  Build configuration options may be used to statically override options in
1899  the "init" structure and will take precedence over initialization data
1900  passed using this function.
1901 */
1902 
1903 SYS_MODULE_OBJ
1905  const SYS_MODULE_INDEX drvIndex ,
1906  const SYS_MODULE_INIT * const init ) ;
1907 // *****************************************************************************
1908 /* Function:
1909  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
1910  Summary:
1911  Deinitializes the specified instance of the Timer driver.
1912  <p><b>Implementation:</b> Dynamic</p>
1913  Description:
1914  Deinitializes the specified instance of the Timer driver, disabling
1915  its operation (and any hardware). All internal data is invalidated.
1916  Precondition:
1917  The DRV_TMR_Initialize function must have been called before calling this
1918  function and a valid SYS_MODULE_OBJ must have been returned.
1919  Parameters:
1920  object - Driver object handle, returned from DRV_TMR_Initialize
1921  Returns:
1922  None.
1923  Example:
1924  <code>
1925  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
1926  SYS_STATUS tmrStatus;
1927  DRV_TMR_Deinitialize ( tmrObject );
1928  tmrStatus = DRV_TMR_Status ( tmrObject );
1929  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
1930  {
1931  // Check again later if you need to know
1932  // when the driver is deinitialized.
1933  }
1934  </code>
1935  Remarks:
1936  Once the Initialize operation has been called, the Deinitialize operation
1937  must be called before the Initialize operation can be called again.
1938  This function will NEVER block waiting for hardware. If the operation
1939  requires time to allow the hardware to complete, this will be reported by
1940  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
1941  out when the module is in the ready state.
1942 */
1943 
1944 void
1946  SYS_MODULE_OBJ object ) ;
1947 // *****************************************************************************
1948 /* Function:
1949  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
1950  Summary:
1951  Provides the current status of the Timer driver.
1952  <p><b>Implementation:</b> Dynamic</p>
1953  Description:
1954  This function provides the current status of the Timer driver.
1955  Precondition:
1956  The DRV_TMR_Initialize function must have been called before calling this
1957  function.
1958  Parameters:
1959  object - Driver object handle, returned from DRV_TMR_Initialize
1960  Returns:
1961  SYS_STATUS_READY - Indicates that the driver is initialized and ready
1962  for operation
1963  Note: Any value greater than SYS_STATUS_READY is
1964  also a normal running state in which the driver
1965  is ready to accept new operations.
1966  SYS_STATUS_ERROR - Indicates that the driver is in an error state
1967  Note: Any value less than SYS_STATUS_ERROR is
1968  also an error state.
1969  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
1970  Note: This value is less than SYS_STATUS_ERROR.
1971  Example:
1972  <code>
1973  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
1974  SYS_STATUS tmrStatus;
1975  tmrStatus = DRV_TMR_Status ( object );
1976  else if ( SYS_STATUS_ERROR >= tmrStatus )
1977  {
1978  // Handle error
1979  }
1980  </code>
1981  Remarks:
1982  The this operation can be used to determine when any of the driver's module
1983  level operations has completed.
1984  Once the status operation returns SYS_STATUS_READY, the driver is ready for
1985  operation.
1986  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
1987  also an error state.
1988  This function will NEVER block waiting for hardware.
1989 */
1990 
1991 SYS_STATUS
1992  DRV_TMR_Status (
1993  SYS_MODULE_OBJ object ) ;
1994 // *****************************************************************************
1995 /* Function:
1996  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
1997  Summary:
1998  Maintains the driver's state machine.
1999  <p><b>Implementation:</b> Dynamic</p>
2000  Description:
2001  This function is used to maintain the driver's internal state machine and
2002  processes the timer events..
2003  Precondition:
2004  The DRV_TMR_Initialize function must have been called for the specified Timer
2005  driver instance.
2006  Parameters:
2007  object - Object handle for the specified driver instance (returned from
2008  DRV_TMR_Initialize)
2009  Returns:
2010  None
2011  Example:
2012  <code>
2013  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2014  while (true)
2015  {
2016  DRV_TMR_Tasks ( object );
2017  // Do other tasks
2018  }
2019  </code>
2020  Remarks:
2021  This function is normally not called directly by an application. It is
2022  called by the system's Tasks routine (SYS_Tasks)
2023 */
2024 
2025 void
2026  DRV_TMR_Tasks (
2027  SYS_MODULE_OBJ object ) ;
2028 // *****************************************************************************
2029 // *****************************************************************************
2030 // Section: TMR Driver Client Functions
2031 // *****************************************************************************
2032 // *****************************************************************************
2033 // *****************************************************************************
2034 /* Function:
2035  DRV_HANDLE DRV_TMR_Open
2036  (
2037  const SYS_MODULE_INDEX index,
2038  const DRV_IO_INTENT intent
2039  )
2040  Summary:
2041  Opens the specified Timer driver instance and returns a handle to it.
2042  <p><b>Implementation:</b> Dynamic</p>
2043  Description:
2044  This function opens the specified Timer driver instance and provides a
2045  handle that must be provided to all other client-level operations to
2046  identify the caller and the instance of the driver. Timer driver does not
2047  support multiple clients. If two tasks want to use the timer, one should
2048  wait until the other one gets closed.
2049  Precondition:
2050  The DRV_TMR_Initialize function must have been called before calling this
2051  function.
2052  Parameters:
2053  index - Identifier for the object instance to be opened
2054  intent - Zero or more of the values from the enumeration
2055  DRV_IO_INTENT ORed together to indicate the intended use
2056  of the driver
2057  Returns:
2058  If successful, the function returns a valid open instance handle (a number
2059  identifying both the caller and the module instance).
2060  If an error occurs, the return value is DRV_HANDLE_INVALID.
2061  Example:
2062  <code>
2063  DRV_HANDLE handle;
2064  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2065  if ( DRV_HANDLE_INVALID == handle )
2066  {
2067  // Unable to open the driver
2068  }
2069  </code>
2070  Remarks:
2071  The handle returned is valid until the DRV_TMR_Close function is called.
2072  This function will NEVER block waiting for hardware.
2073  If the requested intent flags are not supported, the function will return
2074  DRV_HANDLE_INVALID.
2075  The Timer driver does not support DRV_IO_INTENT_SHARED.
2076  Only exclusive access is supported for now.
2077 */
2078 
2079 DRV_HANDLE
2080  DRV_TMR_Open (
2081  const SYS_MODULE_INDEX index ,
2082  const DRV_IO_INTENT intent ) ;
2083 // *****************************************************************************
2084 /* Function:
2085  void DRV_TMR_Close ( DRV_HANDLE handle )
2086  Summary:
2087  Closes an opened instance of the Timer driver.
2088  <p><b>Implementation:</b> Dynamic</p>
2089  Description:
2090  This function closes an opened instance of the Timer driver, invalidating
2091  the handle.
2092  Precondition:
2093  The DRV_TMR_Initialize function must have been called for the specified
2094  Timer driver instance.
2095  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2096  Parameters:
2097  handle - A valid open-instance handle, returned from the driver's
2098  open routine
2099  Returns:
2100  None
2101  Example:
2102  <code>
2103  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2104  DRV_TMR_Close ( handle );
2105  </code>
2106  Remarks:
2107  After calling this function, the handle passed in "handle" must not be used
2108  with any of the remaining driver functions. A new handle must be obtained
2109  by calling DRV_TMR_Open before the caller may use the driver again.
2110  Note: Usually there is no need for the driver client to verify that the Close
2111  operation has completed.
2112 */
2113 
2114 void
2115  DRV_TMR_Close (
2116  DRV_HANDLE handle ) ;
2117 // *****************************************************************************
2118 /* Function:
2119  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2120  Summary:
2121  Gets the status of the client operation.
2122  <p><b>Implementation:</b> Dynamic</p>
2123  Description:
2124  This function gets the status of the recently completed client level
2125  operation.
2126  Precondition:
2127  The DRV_TMR_Initialize function must have been called for the specified
2128  Timer driver instance.
2129  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2130  Parameters:
2131  handle - A valid open-instance handle, returned from the driver's
2132  open routine
2133  Returns:
2134  None
2135  Example:
2136  <code>
2137  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2138  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2139  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2140  </code>
2141  Remarks:
2142  None.
2143 */
2144 
2147  DRV_HANDLE handle ) ;
2148 // *****************************************************************************
2149 // *****************************************************************************
2150 // Section: TMR Driver Counting functions
2151 // *****************************************************************************
2152 // *****************************************************************************
2153 // *****************************************************************************
2154 /* Function:
2155  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2156  Summary:
2157  Updates the Timer's counter register.
2158  <p><b>Implementation:</b> Static/Dynamic</p>
2159  Description:
2160  This function updates the Timer's value in the counter register.
2161  Precondition:
2162  The DRV_TMR_Initialize function must have been called.
2163  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2164  Parameters:
2165  handle - A valid open-instance handle, returned from the driver's
2166  open routine
2167  counterPeriod - counter period value
2168  - a 16 bit value if the timer is configured in 16 bit mode
2169  - a 32 bit value if the timer is configured in 32 bit mode
2170  Returns:
2171  None.
2172  Example:
2173  <code>
2174  </code>
2175  Remarks:
2176  None.
2177 */
2178 
2179 void
2181  DRV_HANDLE handle ,
2182  uint32_t counterPeriod ) ;
2183 // *****************************************************************************
2184 /* Function:
2185  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2186  Summary:
2187  Reads the Timer's counter register.
2188  <p><b>Implementation:</b> Static/Dynamic</p>
2189  Description:
2190  This function returns the Timer's value in the counter register.
2191  Precondition:
2192  The DRV_TMR_Initialize function must have been called.
2193  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2194  Parameters:
2195  handle - A valid open-instance handle, returned from the driver's
2196  open routine
2197  Returns:
2198  Timer current period:
2199  - a 16 bit value if the timer is configured in 16 bit mode
2200  - a 32 bit value if the timer is configured in 32 bit mode
2201  Example:
2202  <code>
2203  //Example to use timer for precision time measurement
2204  //without configuring an alarm (interrupt based)
2205  char appState = 0;
2206  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2207  switch ( appState )
2208  {
2209  case 0:
2210  //Calculate and set the counter period
2211  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2212  //counter starts
2213  DRV_TMR_Start ( tmrHandle );
2214  //Trigger an application operation
2215  app_trigger_operation();
2216  //Check for time-out in the next state
2217  appState++;
2218  case 1:
2219  //Overflows and stops at 0 if no alarm is set
2220  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2221  {
2222  //Time-out
2223  return false;
2224  }
2225  else if ( app_operation_isComplete( ) )
2226  {
2227  //Operation is complete before time-out
2228  return true;
2229  }
2230  </code>
2231  Remarks:
2232  None.
2233 */
2234 
2235 uint32_t
2237  DRV_HANDLE handle ) ;
2238 // *****************************************************************************
2239 /* Function:
2240  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2241  Summary:
2242  Clears the Timer's counter register.
2243  <p><b>Implementation:</b> Static/Dynamic</p>
2244  Description:
2245  This function clears the Timer's value in the counter register.
2246  Precondition:
2247  The DRV_TMR_Initialize function must have been called.
2248  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2249  Parameters:
2250  handle - A valid open-instance handle, returned from the driver's
2251  open routine
2252  Returns:
2253  None.
2254  Example:
2255  <code>
2256  </code>
2257  Remarks:
2258  None.
2259 */
2260 
2261 void
2263  DRV_HANDLE handle ) ;
2264 // *****************************************************************************
2265 /* Function:
2266  bool DRV_TMR_AlarmRegister
2267  (
2268  DRV_HANDLE handle,
2269  uint32_t divider,
2270  bool isPeriodic,
2271  uintptr_t context,
2272  DRV_TMR_CALLBACK callBack
2273  )
2274  Summary:
2275  Sets up an alarm.
2276  <p><b>Implementation:</b> Dynamic</p>
2277  Description:
2278  This function sets up an alarm, allowing the client to receive a callback
2279  from the driver when the timer counter reaches zero. Alarms can be one-shot
2280  or periodic. A periodic alarm will reload the timer and generate alarm
2281  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2282  divider;
2283  Precondition:
2284  The DRV_TMR_Initialize function must have been called.
2285  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2286  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2287  Parameters:
2288  handle - A valid handle, returned from DRV_TMR_Open
2289  divider - The value to divide the timer clock source to obtain the
2290  required alarm frequency.
2291  - a 16 bit value if the timer is configured in 16 bit mode
2292  - a 32 bit value if the timer is configured in 32 bit mode
2293  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2294  context - A reference, call back function will be called with the same
2295  reference.
2296  callBack - A call back function which will be called on time out.
2297  Returns:
2298  - true - if the call succeeded
2299  - false - the obtained divider could not be obtained or the passed handle was invalid
2300  Example:
2301  <code>
2302  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2303  void setupTask ()
2304  {
2305  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2306  uint32_t myFreq = 1000; // 1KHz
2307  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2308  // calculate the divider needed
2309  uint32_t divider = clkFreq / myFreq;
2310  // Start the alarm
2311  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2312  {
2313  // divider value could not be obtain;
2314  // handle the error
2315  //
2316  }
2317  }
2318  </code>
2319  Remarks:
2320  The divider value will be truncated to a 16 bit value if the timer is
2321  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2322  callback.
2323 */
2324 
2325 bool
2327  DRV_HANDLE handle ,
2328  uint32_t divider ,
2329  bool isPeriodic ,
2330  uintptr_t context ,
2331  DRV_TMR_CALLBACK callBack ) ;
2332 // *****************************************************************************
2333 /* Function:
2334  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2335  Summary:
2336  Disables an alarm signal.
2337  <p><b>Implementation:</b> Dynamic</p>
2338  Description:
2339  This function allows the client to disable an alarm generation.
2340  Use DRV_TMR_AlarmEnable to re-enable.
2341  Precondition:
2342  The DRV_TMR_Initialize function must have been called.
2343  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2344  A client alarm must be active.
2345  Parameters:
2346  handle - A valid handle, returned from DRV_TMR_Open
2347  Returns:
2348  The current status of the alarm:
2349  - true if the alarm was currently enabled
2350  - false if the alarm was currently disabled
2351  Example:
2352  <code>
2353  </code>
2354  Remarks:
2355  When the driver operates in interrupts this call resolves to a device
2356  interrupt disable.
2357  Do NOT disable the timer except for very short periods of time. If the time
2358  that the interrupt is disabled is longer than a wrap around period and the
2359  interrupt is missed, the hardware has no means of recovering and the
2360  resulting timing will be inaccurate.
2361 */
2362 
2363 bool
2365  DRV_HANDLE handle ) ;
2366 // *****************************************************************************
2367 /* Function:
2368  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2369  Summary:
2370  Re-enables an alarm signal.
2371  <p><b>Implementation:</b> Dynamic</p>
2372  Description:
2373  This function allows the client to re-enable an alarm after it has been
2374  disabled by a DRV_TMR_AlarmDisable call.
2375  Precondition:
2376  The DRV_TMR_Initialize function must have been called.
2377  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2378  Parameters:
2379  handle - A valid handle, returned from DRV_TMR_Open
2380  enable - boolean to enable the current callback
2381  Returns:
2382  None
2383  Example:
2384  <code>
2385  </code>
2386  Remarks:
2387  When the driver operates in interrupts this call resolves to a device
2388  interrupt re-enable.
2389 */
2390 
2391 void
2393  DRV_HANDLE handle ,
2394  bool enable ) ;
2395 // *****************************************************************************
2396 /* Function:
2397  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2398  Summary:
2399  Updates the Timer's period.
2400  <p><b>Implementation:</b> Dynamic</p>
2401  Description:
2402  This function updates the Timer's period.
2403  Precondition:
2404  The DRV_TMR_Initialize function must have been called.
2405  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2406  Parameters:
2407  handle - A valid open-instance handle, returned from the driver's
2408  open routine
2409  value - Period value
2410  - a 16 bit value if the timer is configured in 16 bit mode
2411  - a 32 bit value if the timer is configured in 32 bit mode
2412  Returns:
2413  None.
2414  Example:
2415  <code>
2416  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2417  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2418  </code>
2419  Remarks:
2420  - The period value will be truncated to a 16 bit value if the timer is
2421  configured in 16 bit mode.
2422 */
2423 
2424 void
2426  DRV_HANDLE handle ,
2427  uint32_t value ) ;
2428 // *****************************************************************************
2429 /* Function:
2430  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2431  Summary:
2432  Provides the Timer's period.
2433  <p><b>Implementation:</b> Dynamic</p>
2434  Description:
2435  This function gets the Timer's period.
2436  Precondition:
2437  The DRV_TMR_Initialize function must have been called.
2438  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2439  Parameters:
2440  handle - A valid open-instance handle, returned from the driver's
2441  open routine
2442  Returns:
2443  Timer period value:
2444  - a 16 bit value if the timer is configured in 16 bit mode
2445  - a 32 bit value if the timer is configured in 32 bit mode
2446  Example:
2447  <code>
2448  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2449  uint32_t period;
2450  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2451  </code>
2452  Remarks:
2453  None.
2454 */
2455 
2456 uint32_t
2458  DRV_HANDLE handle ) ;
2459 // *****************************************************************************
2460 /* Function:
2461  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2462  Summary:
2463  Removes a previously set alarm.
2464  <p><b>Implementation:</b> Dynamic</p>
2465  Description:
2466  This function removes a previously set alarm.
2467  Precondition:
2468  The DRV_TMR_Initialize function must have been called.
2469  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2470  DRV_TMR_AlarmRegister function must have been called before.
2471  Parameters:
2472  handle - A valid open-instance handle, returned from the driver's
2473  open routine
2474  Returns:
2475  None.
2476  Example:
2477  <code>
2478  // Example of a key debounce check
2479  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2480  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2481  void keyPressDetect ()
2482  {
2483  // Calculate the count to be passed on from the clock input
2484  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2485  }
2486  void DebounceCheck ( uintptr_t context )
2487  {
2488  readKey = AppReadKey();
2489  if ( readKey != lastReadKey )
2490  {
2491  lastReadKey = readKey;
2492  keyCount = 0;
2493  }
2494  else
2495  {
2496  if ( keyCount > 20 )
2497  {
2498  globalKeyState = readKey;
2499  DRV_TMR_AlarmDeregister ( tmrHandle );
2500  }
2501  keyCount++;
2502  }
2503  }
2504  </code>
2505  Remarks:
2506  None.
2507 */
2508 
2509 void
2511  DRV_HANDLE handle ) ;
2512 // *****************************************************************************
2513 // *****************************************************************************
2514 // Section: TMR Driver Operation Control Functions
2515 // *****************************************************************************
2516 // *****************************************************************************
2517 // *****************************************************************************
2518 /* Function:
2519  bool DRV_TMR_Start ( DRV_HANDLE handle )
2520  Summary:
2521  Starts the Timer counting.
2522  <p><b>Implementation:</b> Static/Dynamic</p>
2523  Description:
2524  This function starts the Timer counting.
2525  Precondition:
2526  The DRV_TMR_Initialize function must have been called.
2527  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2528  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2529  Parameters:
2530  handle - A valid open-instance handle, returned from the driver's
2531  open routine
2532  Returns:
2533  - true - if the operation succeeded
2534  - false - the supplied handle is invalid or the client doesn't have
2535  the needed parameters to run (alarm callback and period )
2536  Example:
2537  <code>
2538  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2539  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2540  DRV_TMR_Start ( tmrHandle );
2541  </code>
2542  Remarks:
2543  None.
2544 */
2545 
2546 bool
2547  DRV_TMR_Start (
2548  DRV_HANDLE handle ) ;
2549 // *****************************************************************************
2550 /* Function:
2551  void DRV_TMR_Stop ( DRV_HANDLE handle )
2552  Summary:
2553  Stops the Timer from counting.
2554  <p><b>Implementation:</b> Static/Dynamic</p>
2555  Description:
2556  This function stops the running Timer from counting.
2557  Precondition:
2558  The DRV_TMR_Initialize function must have been called.
2559  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2560  Parameters:
2561  handle - A valid open-instance handle, returned from the driver's
2562  open routine
2563  Returns:
2564  None.
2565  Example:
2566  <code>
2567  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2568  DRV_TMR_Stop ( handle );
2569  </code>
2570  Remarks:
2571  None.
2572 */
2573 
2574 void
2575  DRV_TMR_Stop (
2576  DRV_HANDLE handle ) ;
2577 // *****************************************************************************
2578 // *****************************************************************************
2579 // Section: TMR Driver Operation Status Functions
2580 // *****************************************************************************
2581 // *****************************************************************************
2582 // *****************************************************************************
2583 /* Function:
2584  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
2585  Summary:
2586  Provides the status of Timer's period elapse.
2587  <p><b>Implementation:</b> Dynamic</p>
2588  Description:
2589  This function returns the number of times Timer's period has elapsed since
2590  last call to this API has made. On calling this API, the internally
2591  maintained counter will be cleared and count will be started again from next
2592  elapse.
2593  Precondition:
2594  The DRV_TMR_Initialize function must have been called.
2595  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2596  Parameters:
2597  handle - A valid handle, returned from the DRV_TMR_Open
2598  Returns:
2599  Number of times timer has elapsed since the last call.
2600  Example:
2601  <code>
2602  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2603  bool elapseStatus;
2604  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
2605  unsigned int appInternalTime = 0;
2606  Sys_Tasks()
2607  {
2608  //Timer task will be called from ISR
2609  APP_TimeUpdate_Task();
2610  //Other Tasks
2611  }
2612  void APP_TimeUpdate_Task ( void )
2613  {
2614  //We will not miss a count even though we are late
2615  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
2616  }
2617  </code>
2618  Remarks:
2619  None.
2620 */
2621 
2622 uint32_t
2624  DRV_HANDLE handle ) ;
2625 // *****************************************************************************
2626 // *****************************************************************************
2627 // Section: TMR Driver Control and Information Functions
2628 // *****************************************************************************
2629 // *****************************************************************************
2630 // *****************************************************************************
2631 /* Function:
2632  bool DRV_TMR_ClockSet
2633  (
2634  DRV_HANDLE handle,
2635  DRV_TMR_CLK_SOURCES clockSource,
2636  TMR_PRESCALE preScale
2637  )
2638  Summary:
2639  Sets the timers clock by selecting the source and prescaler.
2640  <p><b>Implementation:</b> Dynamic</p>
2641  Description:
2642  This function sets the timer clock by selecting the source and prescaler.
2643  The clock sources are device specific, refer device datasheet for supported
2644  clock sources. If unsupported clock source is passed then the behaviour of
2645  this function is unpredictable.
2646  Precondition:
2647  The DRV_TMR_Initialize function must have been called. Must have selected
2648  32-Bit timer mode if mode selection is applicable.
2649  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2650  Parameters:
2651  handle - A valid open-instance handle, returned from the driver's
2652  open routine
2653  clockSource - Clock source of the timer
2654  preScale - Timer's Prescaler divisor
2655  Returns:
2656  - true - if the operation is successful
2657  - false - either the handle is invalid or the clockSource
2658  and/or prescaler are not supported
2659  Example:
2660  <code>
2661  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2662  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
2663  </code>
2664  Remarks:
2665  None.
2666 */
2667 
2668 bool
2670  DRV_HANDLE handle ,
2671  DRV_TMR_CLK_SOURCES clockSource ,
2672  TMR_PRESCALE preScale ) ;
2673 // *****************************************************************************
2674 /* Function:
2675  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
2676  Summary:
2677  This function gets the currently selected prescaler.
2678  <p><b>Implementation:</b> Dynamic</p>
2679  Description:
2680  This function gets the currently selected prescaler.
2681  Precondition:
2682  The DRV_TMR_Initialize function must have been called.
2683  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2684  Parameters:
2685  handle - A valid open-instance handle, returned from the driver's
2686  open routine
2687  Returns:
2688  Timer prescaler.
2689  Example:
2690  <code>
2691  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2692  TMR_PRESCALE preScale;
2693  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
2694  </code>
2695  Remarks:
2696  None.
2697 */
2698 
2699 TMR_PRESCALE
2701  DRV_HANDLE handle ) ;
2702 // *****************************************************************************
2703 /* Function:
2704  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
2705  Summary:
2706  This function gets the currently selected operation mode.
2707  <p><b>Implementation:</b> Dynamic</p>
2708  Description:
2709  This function gets the currently selected 16/32 bit operation mode.
2710  Precondition:
2711  The DRV_TMR_Initialize function must have been called.
2712  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2713  Parameters:
2714  handle - A valid open-instance handle, returned from the driver's
2715  open routine
2716  Returns:
2717  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
2718  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
2719  handle.
2720  Example:
2721  <code>
2722  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2723  DRV_TMR_OPERATION_MODE operMode;
2724  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
2725  </code>
2726  Remarks:
2727  None.
2728 */
2729 
2732  DRV_HANDLE handle ) ;
2733 // *****************************************************************************
2734 /* Function:
2735  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
2736  Summary:
2737  Enables the Gate mode.
2738  <p><b>Implementation:</b> Dynamic</p>
2739  Description:
2740  This function enables the Gated mode of Timer. User can measure the duration
2741  of an external signal in this mode. Once the Gate mode is enabled, Timer
2742  will start on the raising edge of the external signal. It will keep counting
2743  until the next falling edge.
2744  Precondition:
2745  The DRV_TMR_Initialize function must have been called.
2746  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2747  Parameters:
2748  handle - A valid open-instance handle, returned from the driver's
2749  open routine
2750  Returns:
2751  - true - if the operation is successful
2752  - false - either the handle is invalid or the gate mode
2753  is not supported
2754  Example:
2755  <code>
2756  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2757  DRV_TMR_GateModeSet ( tmrHandle );
2758  </code>
2759  Remarks:
2760  None.
2761 */
2762 
2763 bool
2765  DRV_HANDLE handle ) ;
2766 // *****************************************************************************
2767 /* Function:
2768  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
2769  Summary:
2770  Enables the Gate mode.
2771  <p><b>Implementation:</b> Dynamic</p>
2772  Description:
2773  This function enables the Gated mode of Timer. User can measure the duration
2774  of an external signal in this mode. Once the Gate mode is enabled, Timer
2775  will start on the raising edge of the external signal. It will keep counting
2776  until the next falling edge.
2777  Precondition:
2778  The DRV_TMR_Initialize function must have been called.
2779  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2780  Parameters:
2781  handle - A valid open-instance handle, returned from the driver's
2782  open routine
2783  Returns:
2784  - true - if the operation is successful
2785  - false - either the handle is invalid or the gate mode
2786  is not supported
2787  Example:
2788  <code>
2789  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2790  DRV_TMR_GateModeClear ( tmrHandle );
2791  </code>
2792  Remarks:
2793  None.
2794 */
2795 
2796 bool
2798  DRV_HANDLE handle ) ;
2799 // *****************************************************************************
2800 /* Function:
2801  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
2802  Summary:
2803  Provides the Timer input frequency.
2804  <p><b>Implementation:</b> Dynamic</p>
2805  Description:
2806  This function provides the Timer input frequency. Input frequency is the
2807  clock to the Timer register and it is considering the prescaler divisor.
2808  Precondition:
2809  The DRV_TMR_Initialize function must have been called.
2810  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2811  Parameters:
2812  handle - A valid open-instance handle, returned from the driver's
2813  open routine
2814  Returns:
2815  32-bit value corresponding to the running frequency.
2816  If Timer clock source is external, then this function returns 0.
2817  Example:
2818  <code>
2819  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2820  uint32_t clkFreqHz;
2821  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2822  </code>
2823  Remarks:
2824  On most processors, the Timer's base frequency is the same as the peripheral
2825  bus clock.
2826 */
2827 
2828 uint32_t
2830  DRV_HANDLE handle ) ;
2831 // *****************************************************************************
2832 /* Function:
2833  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
2834  (
2835  DRV_HANDLE handle,
2836  DRV_TMR_DIVIDER_RANGE* pDivRange
2837  )
2838  Summary:
2839  Returns the Timer divider values.
2840  <p><b>Implementation:</b> Dynamic</p>
2841  Description:
2842  This function provides the Timer operating mode and divider range.
2843  Precondition:
2844  The DRV_TMR_Initialize function must have been called.
2845  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2846  Parameters:
2847  handle - A valid open-instance handle, returned from the driver's
2848  open routine
2849  pDivRange - Address to store the timer divider range.
2850  Returns:
2851  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
2852  The pDivRange is updated with the supported range values.
2853  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
2854  Example:
2855  <code>
2856  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2857  DRV_TMR_OPERATION_MODE timerMode;
2858  DRV_TMR_DIVIDER_RANGE timerRange;
2859  DRV_TMR_DividerRangeGet(handle, &timerRange);
2860  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2861  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
2862  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
2863  </code>
2864  Remarks:
2865  None.
2866 */
2867 
2870  DRV_HANDLE handle ,
2871  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
2872 // *****************************************************************************
2873 // *****************************************************************************
2874 // Section: File includes for the APIs which are required for backward
2875 // compatibility.
2876 // *****************************************************************************
2877 // *****************************************************************************
2878 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
2879 /*******************************************************************************
2880  Timer Device Driver Interface Definition
2881  Company:
2882  Microchip Technology Inc.
2883  File Name:
2884  drv_tmr_compatibility.h
2885  Summary:
2886  Timer device driver interface header file.
2887  Description:
2888  This header file contains macro definition for APIs which will be deprecated
2889  later. This header file is included in drv_tmr.h.
2890 *******************************************************************************/
2891 //DOM-IGNORE-BEGIN
2892 /*******************************************************************************
2893 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2894 Microchip licenses to you the right to use, modify, copy and distribute
2895 Software only when embedded on a Microchip microcontroller or digital signal
2896 controller that is integrated into your product or third party product
2897 (pursuant to the sublicense terms in the accompanying license agreement).
2898 You should refer to the license agreement accompanying this Software for
2899 additional information regarding your rights and obligations.
2900 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2901 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2902 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2903 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2904 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2905 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2906 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2907 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2908 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2909 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2910 *******************************************************************************/
2911 //DOM-IGNORE-END
2912 #ifndef _DRV_TMR_DEPRECATED_H
2913 #define _DRV_TMR_DEPRECATED_H
2914 // *****************************************************************************
2915 // *****************************************************************************
2916 // Section: File includes
2917 // *****************************************************************************
2918 // *****************************************************************************
2919 // *****************************************************************************
2920 /* Function:
2921  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
2922  Summary:
2923  Maintains the driver's state machine, processes the events and implements
2924  its ISR.
2925  <p><b>Implementation:</b> Dynamic</p>
2926  Description:
2927  This function is used to maintain the driver's internal state machine and
2928  processes the timer events in interrupt-driven implementations
2929  (DRV_TMR_INTERRUPT_MODE == true).
2930  Precondition:
2931  The DRV_TMR_Initialize function must have been called for the specified Timer
2932  driver instance.
2933  Parameters:
2934  object - Object handle for the specified driver instance (returned from
2935  DRV_TMR_Initialize)
2936  Returns:
2937  None
2938  Example:
2939  <code>
2940  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
2941  {
2942  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
2943  }
2944  </code>
2945  Remarks:
2946  This function is normally not called directly by an application.
2947  It is called by the timer driver raw ISR.
2948  This function will execute in an ISR context and will never block or access any
2949  resources that may cause it to block.
2950 
2951  This function will be deprecated later, so avoid using it as much as possible.
2952  Use generic function "DRV_TMR_Tasks" instead of this.
2953 */
2954 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
2955 // *****************************************************************************
2956 /* Function:
2957  void DRV_TMR_CounterValue16BitSet
2958  (
2959  DRV_HANDLE handle,
2960  uint16_t counterPeriod
2961  )
2962  Summary:
2963  Updates the 16-bit Timer's counter register.
2964  <p><b>Implementation:</b> Dynamic</p>
2965  Description:
2966  This function updates the 16-bit Timer's value in the counter register. This
2967  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
2968  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
2969  DRV_TMR_CounterValue32BitSet function.
2970  Precondition:
2971  The DRV_TMR_Initialize function must have been called. Must have selected
2972  16-Bit timer mode if mode selection is applicable.
2973  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2974  Parameters:
2975  handle - A valid open-instance handle, returned from the driver's
2976  open routine
2977  counterPeriod - 16-bit counter period value
2978  Returns:
2979  None.
2980  Example:
2981  <code>
2982  //Example to use timer for precision time measurement
2983  //without configuring an alarm (interrupt based)
2984  char appState = 0;
2985  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2986 
2987  switch ( appState )
2988  {
2989  case 0:
2990  //Calculate and set the counter period
2991  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2992 
2993  //counter starts
2994  DRV_TMR_Start ( tmrHandle );
2995 
2996  //Trigger an application operation
2997  app_trigger_operation();
2998 
2999  //Check for time-out in the next state
3000  appState++;
3001  case 1:
3002  //Overflows and stops at 0 if no alarm is set
3003  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3004  {
3005  //Time-out
3006  return false;
3007  }
3008  else if ( app_operation_isComplete( ) )
3009  {
3010  //Operation is complete before time-out
3011  return true;
3012  }
3013  </code>
3014  Remarks:
3015  This function will be deprecated later, so avoid using it as much as possible.
3016  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3017 */
3018 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3019 // *****************************************************************************
3020 /* Function:
3021  void DRV_TMR_CounterValue32BitSet
3022  (
3023  DRV_HANDLE handle,
3024  uint32_t counterPeriod
3025  )
3026  Summary:
3027  Updates the 32-bit Timer's counter register.
3028  <p><b>Implementation:</b> Dynamic</p>
3029  Description:
3030  This function updates the 32-bit Timer's value in the counter register. This
3031  is valid only if the 32-bit mode of the timer is selected Otherwise use
3032  DRV_TMR_CounterValue16BitSet function.
3033  Precondition:
3034  The DRV_TMR_Initialize function must have been called. Must have selected
3035  32-Bit timer mode.
3036  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3037  Parameters:
3038  handle - A valid open-instance handle, returned from the driver's
3039  open routine
3040  counterPeriod - 32-bit counter period value
3041  Returns:
3042  None.
3043  Example:
3044  <code>
3045  //Example to use timer for precision time measurement
3046  //without configuring an alarm (interrupt based)
3047  char appState = 0;
3048  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3049 
3050  switch ( appState )
3051  {
3052  case 0:
3053  //Calculate and set the counter period
3054  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3055 
3056  //counter starts
3057  DRV_TMR_Start ( tmrHandle );
3058 
3059  //Trigger an application operation against which we want to use the time-out
3060  app_trigger_operation();
3061 
3062  //Check for time-out in the next state
3063  appState++;
3064  case 1:
3065  //Overflows and stops at 0 if no alarm is set
3066  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3067  {
3068  //Time-out
3069  return false;
3070  }
3071  else if ( app_operation_isComplete( ) )
3072  {
3073  //Operation is complete before time-out
3074  return true;
3075  }
3076  </code>
3077  Remarks:
3078  In most of the devices only even numbered instances of timer supports
3079  32-bit mode.
3080  This function will be deprecated later, so avoid using it as much as possible.
3081  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3082 */
3083 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3084 // *****************************************************************************
3085 /* Function:
3086  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3087  Summary:
3088  Reads the 16-bit Timer's counter register.
3089  <p><b>Implementation:</b> Dynamic</p>
3090  Description:
3091  This function returns the 16-bit Timer's value in the counter register. This
3092  is valid only if the 16-bit mode of the timer is selected.
3093  Otherwise use DRV_TMR_CounterValue32BitGet function.
3094  Precondition:
3095  The DRV_TMR_Initialize function must have been called. Must have selected
3096  16-Bit timer mode if mode selection is applicable.
3097  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3098  Parameters:
3099  handle - A valid open-instance handle, returned from the driver's
3100  open routine
3101 
3102  Returns:
3103  Timer period in 16-bit mode.
3104  Example:
3105  <code>
3106  //Example to use timer for precision time measurement
3107  //without configuring an alarm (interrupt based)
3108  char appState = 0;
3109  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3110 
3111  switch ( appState )
3112  {
3113  case 0:
3114  //Calculate and set the counter period
3115  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3116 
3117  //counter starts
3118  DRV_TMR_Start ( tmrHandle );
3119 
3120  //Trigger an application operation
3121  app_trigger_operation();
3122 
3123  //Check for time-out in the next state
3124  appState++;
3125  case 1:
3126  //Overflows and stops at 0 if no alarm is set
3127  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3128  {
3129  //Time-out
3130  return false;
3131  }
3132  else if ( app_operation_isComplete( ) )
3133  {
3134  //Operation is complete before time-out
3135  return true;
3136  }
3137  </code>
3138  Remarks:
3139  This function will be deprecated later, so avoid using it as much as possible.
3140  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3141 */
3142 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3143 // *****************************************************************************
3144 /* Function:
3145  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3146  Summary:
3147  Reads the 32-bit Timer's counter register.
3148  <p><b>Implementation:</b> Dynamic</p>
3149  Description:
3150  This function returns the 32-bit Timer's value in the counter register. This
3151  is valid only if the 32-bit mode of the timer is selected Otherwise use
3152  DRV_TMR_CounterValue16BitGet function.
3153  Precondition:
3154  The DRV_TMR_Initialize function must have been called. Must have selected
3155  32-Bit timer mode.
3156  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3157  Parameters:
3158  handle - A valid open-instance handle, returned from the driver's
3159  open routine
3160 
3161  Returns:
3162  32-Bit Counter value.
3163  Example:
3164  <code>
3165  //Example to use timer for precision time measurement
3166  //without configuring an alarm (interrupt based)
3167  char appState = 0;
3168  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3169 
3170  switch ( appState )
3171  {
3172  case 0:
3173  //Calculate and set the counter period
3174  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3175 
3176  //counter starts
3177  DRV_TMR_Start ( tmrHandle );
3178 
3179  //Trigger an application operation
3180  app_trigger_operation();
3181 
3182  //Check for time-out in the next state
3183  appState++;
3184  case 1:
3185  //Overflows and stops at 0 if no alarm is set
3186  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3187  {
3188  //Time-out
3189  return false;
3190  }
3191  else if ( app_operation_isComplete( ) )
3192  {
3193  //Operation is complete before time-out
3194  return true;
3195  }
3196  </code>
3197  Remarks:
3198  In most of the devices only even numbered instances of timer supports
3199  32-bit mode.
3200  This function will be deprecated later, so avoid using it as much as possible.
3201  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3202 */
3203 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3204 // *****************************************************************************
3205 /* Function:
3206  void DRV_TMR_Alarm16BitRegister
3207  (
3208  DRV_HANDLE handle,
3209  uint16_t period,
3210  bool isPeriodic,
3211  uintptr_t context,
3212  DRV_TMR_CALLBACK callBack
3213  )
3214  Summary:
3215  Sets up an alarm.
3216  <p><b>Implementation:</b> Dynamic</p>
3217  Description:
3218  This function sets up an alarm, allowing the client to receive a callback
3219  from the driver when the counter period elapses. Alarms can be one-shot or
3220  periodic. This API is valid only if the 16-bit mode of the timer is
3221  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3222  Precondition:
3223  The DRV_TMR_Initialize function must have been called. Must have selected
3224  16-Bit timer mode if mode selection is applicable.
3225  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3226  Parameters:
3227  handle - A valid handle, returned from DRV_TMR_Open
3228  period - 16-bit period which will be loaded into the Timer hardware register.
3229 
3230  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3231 
3232  context - A reference, call back function will be called with the same
3233  reference.
3234 
3235  callBack - A call back function which will be called on period elapse.
3236 
3237  Returns:
3238  None
3239  Example:
3240  <code>
3241  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3242 
3243  void setupTask ()
3244  {
3245  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3246 
3247  // Calculate the count to be passed on from the clock input
3248  //Periodically toggle LED
3249  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3250  ToggleLedCallBack );
3251  }
3252 
3253  void ToggleLedCallBack ( uintptr_t context )
3254  {
3255  //Toggle
3256  }
3257  </code>
3258  Remarks:
3259  This function will be deprecated later, so avoid using it as much as possible.
3260  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3261 */
3262 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3263 // *****************************************************************************
3264 /* Function:
3265  void DRV_TMR_Alarm32BitRegister
3266  (
3267  DRV_HANDLE handle,
3268  uint32_t period,
3269  bool isPeriodic,
3270  uintptr_t context,
3271  DRV_TMR_CALLBACK callBack
3272  )
3273  Summary:
3274  Sets up an alarm.
3275  <p><b>Implementation:</b> Dynamic</p>
3276  Description:
3277  This function sets up an alarm, allowing the client to receive a callback
3278  from the driver when the counter period elapses. Alarms can be one-shot or
3279  periodic. This API is valid only if the 32-bit mode of the timer is
3280  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3281  Precondition:
3282  The DRV_TMR_Initialize function must have been called. Must have selected
3283  32-Bit timer mode.
3284  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3285  Parameters:
3286  handle - A valid handle, returned from DRV_TMR_Open
3287  period - 32-bit period which will be loaded into the Timer hardware register.
3288 
3289  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3290 
3291  context - A reference, call back function will be called with the same
3292  reference.
3293 
3294  callBack - A call back function which will be called on period elapse.
3295 
3296  Returns:
3297  None
3298  Example:
3299  <code>
3300  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3301 
3302  void setupTask ()
3303  {
3304  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3305 
3306  // Calculate the count to be passed on from the clock input
3307  //Periodically toggle LED
3308  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3309  ToggleLedCallBack );
3310  }
3311 
3312  void ToggleLedCallBack ( uintptr_t context )
3313  {
3314  //Toggle
3315  }
3316  </code>
3317  Remarks:
3318  In most of the devices only even numbered instances of timer supports
3319  32-bit mode.
3320  This function will be deprecated later, so avoid using it as much as possible.
3321  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3322 */
3323 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3324 // *****************************************************************************
3325 /* Function:
3326  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3327  Summary:
3328  Updates the 16-bit Timer's period.
3329  <p><b>Implementation:</b> Dynamic</p>
3330  Description:
3331  This function updates the 16-bit Timer's period. This API is valid only if
3332  the 16-bit mode of the timer is selected
3333  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3334  Precondition:
3335  The DRV_TMR_Initialize function must have been called. Must have selected
3336  16-Bit timer mode if mode selection is applicable.
3337  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3338  Parameters:
3339  handle - A valid open-instance handle, returned from the driver's
3340  open routine
3341  value - 16-bit Period value
3342  Returns:
3343  None.
3344  Example:
3345  <code>
3346  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3347  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3348  </code>
3349  Remarks:
3350  This function will be deprecated later, so avoid using it as much as possible.
3351  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3352 */
3353 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3354 // *****************************************************************************
3355 /* Function:
3356  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3357  Summary:
3358  Updates the 32-bit Timer's period.
3359  <p><b>Implementation:</b> Dynamic</p>
3360  Description:
3361  This function updates the 32-bit Timer's period. This API is valid only if
3362  the 32-bit mode of the timer is selected
3363  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3364  Precondition:
3365  The DRV_TMR_Initialize unction must have been called. Must have selected
3366  32-Bit timer mode.
3367  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3368  Parameters:
3369  handle - A valid open-instance handle, returned from the driver's
3370  open routine
3371  period - 32-bit Period value
3372  Returns:
3373  None.
3374  Example:
3375  <code>
3376  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3377  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3378  </code>
3379  Remarks:
3380  In most of the devices only even numbered instances of timer supports
3381  32-bit mode.
3382  This function will be deprecated later, so avoid using it as much as possible.
3383  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3384 */
3385 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3386 // *****************************************************************************
3387 /* Function:
3388  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3389  Summary:
3390  Provides the 16-bit Timer's period.
3391  <p><b>Implementation:</b> Dynamic</p>
3392  Description:
3393  This function gets the 16-bit Timer's period. This API is valid only if
3394  the 16-bit mode of the timer is selected.
3395  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3396  Precondition:
3397  The DRV_TMR_Initialize function must have been called. Must have selected
3398  16-Bit timer mode if mode selection is applicable.
3399  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3400  Parameters:
3401  handle - A valid open-instance handle, returned from the driver's
3402  open routine
3403  Returns:
3404  16-bit timer period value
3405  Example:
3406  <code>
3407  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3408  uint16_t period;
3409 
3410  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3411  </code>
3412  Remarks:
3413  This function will be deprecated later, so avoid using it as much as possible.
3414  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3415 */
3416 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3417 // *****************************************************************************
3418 /* Function:
3419  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3420  Summary:
3421  Provides the 32-bit Timer's period.
3422  <p><b>Implementation:</b> Dynamic</p>
3423  Description:
3424  This function gets the 32-bit Timer's period. This API is valid only if
3425  the 32-bit mode of the timer is selected
3426  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3427  Precondition:
3428  The DRV_TMR_Initialize function must have been called. Must have selected
3429  32-Bit timer mode.
3430  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3431  Parameters:
3432  handle - A valid open-instance handle, returned from the driver's
3433  open routine
3434  Returns:
3435  32-bit Timer period value.
3436  Example:
3437  <code>
3438  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3439  uint32_t period;
3440  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3441  </code>
3442  Remarks:
3443  In most of the devices only even numbered instances of timer supports
3444  32-bit mode.
3445  This function will be deprecated later, so avoid using it as much as possible.
3446  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3447 */
3448 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3449 // *****************************************************************************
3450 /* Function:
3451  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3452  Summary:
3453  Removes a previously set alarm.
3454  <p><b>Implementation:</b> Dynamic</p>
3455  Description:
3456  This function removes a previously set alarm. This API is valid only if
3457  the 16-bit mode of the timer is selected
3458  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3459  Precondition:
3460  The DRV_TMR_Initialize function must have been called. Must have selected
3461  16-Bit timer mode if mode selection is applicable.
3462  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3463 
3464  DRV_TMR_Alarm16BitRegister function must have been called before.
3465  Parameters:
3466  handle - A valid open-instance handle, returned from the driver's
3467  open routine
3468  Returns:
3469  None.
3470  Example:
3471  <code>
3472  //Example of a key debounce check
3473 
3474  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3475  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3476  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3477 
3478  void keyPressDetect ()
3479  {
3480  // Calculate the count to be passed on from the clock input
3481  //Periodically toggle LED
3482  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3483  DebounceCheck );
3484  }
3485 
3486  void DebounceCheck ( uintptr_t context )
3487  {
3488  readKey = AppReadKey();
3489 
3490  if ( readKey != lastReadKey )
3491  {
3492  lastReadKey = readKey;
3493  keyCount = 0;
3494  }
3495  else
3496  {
3497  if ( keyCount > 20 )
3498  {
3499  globalKeyState = readKey;
3500  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3501  }
3502  keyCount++;
3503  }
3504  }
3505  </code>
3506  Remarks:
3507  This function will be deprecated later, so avoid using it as much as possible.
3508  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3509 */
3510 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3511 // *****************************************************************************
3512 /* Function:
3513  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3514  Summary:
3515  Removes a previously set alarm.
3516  <p><b>Implementation:</b> Dynamic</p>
3517  Description:
3518  This function removes a previously set alarm. This API is valid only if
3519  the 32-bit mode of the timer is selected
3520  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3521  Precondition:
3522  The DRV_TMR_Initialize function must have been called. Must have selected
3523  32-Bit timer mode if mode selection is applicable.
3524  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3525 
3526  DRV_TMR_Alarm32BitRegister function must have been called before.
3527  Parameters:
3528  handle - A valid open-instance handle, returned from the driver's
3529  open routine
3530  Returns:
3531  None.
3532  Example:
3533  <code>
3534  //Example of a key debounce check
3535 
3536  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3537  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3538  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3539 
3540  void keyPressDetect ( void )
3541  {
3542  // Calculate the count to be passed on from the clock input
3543  //Periodically check the key status
3544  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
3545  DebounceCheck );
3546  }
3547 
3548  void DebounceCheck ( uintptr_t context )
3549  {
3550  readKey = AppReadKey();
3551 
3552  if ( readKey != lastReadKey )
3553  {
3554  lastReadKey = readKey;
3555  keyCount = 0;
3556  }
3557  else
3558  {
3559  if ( keyCount > 20 )
3560  {
3561  //Key is stable now
3562  globalKeyState = readKey;
3563  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
3564  }
3565  keyCount++;
3566  }
3567  }
3568  </code>
3569  Remarks:
3570  In most of the devices only even numbered instances of timer supports
3571  32-bit mode.
3572  This function will be deprecated later, so avoid using it as much as possible.
3573  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3574 */
3575 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3576  // #ifndef _DRV_TMR_DEPRECATED_H
3577 /*******************************************************************************
3578  End of File
3579 */
3580 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
3581 /* CLOSE_FILE Include File */
3582 
3583 //DOM-IGNORE-BEGIN
3584 //DOM-IGNORE-END
3585  // #ifndef _DRV_TMR_H
3586 /*******************************************************************************
3587  End of File
3588 */
3589 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
3590 /* CLOSE_FILE Include File */
3591 
3592 #include "peripheral/tmr/plib_tmr.h"
3593 #include "peripheral/int/plib_int.h"
3594 // maximum divider value for 32 bit operation mode
3595 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
3596 // minimum divider value for 32 bit operation mode
3597 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
3598 // maximum divider value for 16 bit operation mode
3599 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
3600 // minimum divider value for 16 bit operation mode
3601 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
3602 // *****************************************************************************
3603 // *****************************************************************************
3604 // Section: Interface Headers for Instance 0 for the static driver
3605 // *****************************************************************************
3606 // *****************************************************************************
3607 
3608 void
3609  DRV_TMR0_Initialize ( void ) ;
3610 
3611 bool
3612  DRV_TMR0_Start ( void ) ;
3613 
3614 void
3615  DRV_TMR0_Stop ( void ) ;
3616 
3617 static inline void
3619  {
3620  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
3621  DRV_TMR0_Stop () ;
3622  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
3623  hvps_test_67zqendz ( 2 ) ; /* 30 */
3624  }
3625 
3626 static inline SYS_STATUS
3628 {
3629  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
3630  /* Return the status as ready always */
3631  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
3632  hvps_test_67zqendz ( 4 ) ; /* 30 */
3633  return
3634  SYS_STATUS_READY ;
3635 }
3636 
3637 static inline void
3638  DRV_TMR0_Open ( void )
3639  {
3640  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
3641  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
3642  hvps_test_67zqendz ( 6 ) ; /* 30 */
3643  }
3644 
3646  DRV_TMR0_ClientStatus ( void ) ;
3647 
3648 static inline DRV_TMR_OPERATION_MODE
3650 {
3651  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
3652  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
3653  hvps_test_67zqendz ( 8 ) ; /* 30 */
3654  return
3656 }
3657 
3658 static inline void
3660  {
3661  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
3662  DRV_TMR0_Stop () ;
3663  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
3664  hvps_test_67zqendz ( 10 ) ; /* 30 */
3665  }
3666 
3667 bool
3669  DRV_TMR_CLK_SOURCES clockSource ,
3670  TMR_PRESCALE prescale ) ;
3671 
3672 void
3674  uint32_t value ) ;
3675 
3676 uint32_t
3677  DRV_TMR0_CounterValueGet ( void ) ;
3678 
3679 void
3680  DRV_TMR0_CounterClear ( void ) ;
3681 
3682 TMR_PRESCALE
3683  DRV_TMR0_PrescalerGet ( void ) ;
3684 
3685 void
3687  uint32_t value ) ;
3688 
3689 uint32_t
3690  DRV_TMR0_PeriodValueGet ( void ) ;
3691 
3692 void
3693  DRV_TMR0_StopInIdleDisable ( void ) ;
3694 
3695 void
3696  DRV_TMR0_StopInIdleEnable ( void ) ;
3697 
3698 static inline void
3700  {
3701  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
3702  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
3703  hvps_test_67zqendz ( 12 ) ; /* 30 */
3704  }
3705 
3706 uint32_t
3707  DRV_TMR0_CounterFrequencyGet ( void ) ;
3708 
3711  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3712 // *****************************************************************************
3713 // *****************************************************************************
3714 // Section: Interface Headers for Instance 1 for the static driver
3715 // *****************************************************************************
3716 // *****************************************************************************
3717 
3718 void
3719  DRV_TMR1_Initialize ( void ) ;
3720 
3721 bool
3722  DRV_TMR1_Start ( void ) ;
3723 
3724 void
3725  DRV_TMR1_Stop ( void ) ;
3726 
3727 static inline void
3729  {
3730  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
3731  DRV_TMR1_Stop () ;
3732  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
3733  hvps_test_67zqendz ( 14 ) ; /* 30 */
3734  }
3735 
3736 static inline SYS_STATUS
3738 {
3739  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
3740  /* Return the status as ready always */
3741  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
3742  hvps_test_67zqendz ( 16 ) ; /* 30 */
3743  return
3744  SYS_STATUS_READY ;
3745 }
3746 
3747 static inline void
3748  DRV_TMR1_Open ( void )
3749  {
3750  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
3751  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
3752  hvps_test_67zqendz ( 18 ) ; /* 30 */
3753  }
3754 
3756  DRV_TMR1_ClientStatus ( void ) ;
3757 
3758 static inline DRV_TMR_OPERATION_MODE
3760 {
3761  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
3762  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
3763  hvps_test_67zqendz ( 20 ) ; /* 30 */
3764  return
3766 }
3767 
3768 static inline void
3770  {
3771  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
3772  DRV_TMR1_Stop () ;
3773  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
3774  hvps_test_67zqendz ( 22 ) ; /* 30 */
3775  }
3776 
3777 bool
3779  DRV_TMR_CLK_SOURCES clockSource ,
3780  TMR_PRESCALE prescale ) ;
3781 
3782 void
3784  uint32_t value ) ;
3785 
3786 uint32_t
3787  DRV_TMR1_CounterValueGet ( void ) ;
3788 
3789 void
3790  DRV_TMR1_CounterClear ( void ) ;
3791 
3792 TMR_PRESCALE
3793  DRV_TMR1_PrescalerGet ( void ) ;
3794 
3795 void
3797  uint32_t value ) ;
3798 
3799 uint32_t
3800  DRV_TMR1_PeriodValueGet ( void ) ;
3801 
3802 void
3803  DRV_TMR1_StopInIdleDisable ( void ) ;
3804 
3805 void
3806  DRV_TMR1_StopInIdleEnable ( void ) ;
3807 
3808 static inline void
3810  {
3811  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
3812  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
3813  hvps_test_67zqendz ( 24 ) ; /* 30 */
3814  }
3815 
3816 uint32_t
3817  DRV_TMR1_CounterFrequencyGet ( void ) ;
3818 
3821  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3822 // *****************************************************************************
3823 // *****************************************************************************
3824 // Section: Interface Headers for Instance 2 for the static driver
3825 // *****************************************************************************
3826 // *****************************************************************************
3827 
3828 void
3829  DRV_TMR2_Initialize ( void ) ;
3830 
3831 bool
3832  DRV_TMR2_Start ( void ) ;
3833 
3834 void
3835  DRV_TMR2_Stop ( void ) ;
3836 
3837 static inline void
3839  {
3840  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
3841  DRV_TMR2_Stop () ;
3842  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
3843  hvps_test_67zqendz ( 26 ) ; /* 30 */
3844  }
3845 
3846 static inline SYS_STATUS
3848 {
3849  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
3850  /* Return the status as ready always */
3851  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
3852  hvps_test_67zqendz ( 28 ) ; /* 30 */
3853  return
3854  SYS_STATUS_READY ;
3855 }
3856 
3857 static inline void
3858  DRV_TMR2_Open ( void )
3859  {
3860  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
3861  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
3862  hvps_test_67zqendz ( 30 ) ; /* 30 */
3863  }
3864 
3866  DRV_TMR2_ClientStatus ( void ) ;
3867 
3868 static inline DRV_TMR_OPERATION_MODE
3870 {
3871  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
3872  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
3873  hvps_test_67zqendz ( 32 ) ; /* 30 */
3874  return
3876 }
3877 
3878 static inline void
3880  {
3881  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
3882  DRV_TMR2_Stop () ;
3883  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
3884  hvps_test_67zqendz ( 34 ) ; /* 30 */
3885  }
3886 
3887 bool
3889  DRV_TMR_CLK_SOURCES clockSource ,
3890  TMR_PRESCALE prescale ) ;
3891 
3892 void
3894  uint32_t value ) ;
3895 
3896 uint32_t
3897  DRV_TMR2_CounterValueGet ( void ) ;
3898 
3899 void
3900  DRV_TMR2_CounterClear ( void ) ;
3901 
3902 TMR_PRESCALE
3903  DRV_TMR2_PrescalerGet ( void ) ;
3904 
3905 void
3907  uint32_t value ) ;
3908 
3909 uint32_t
3910  DRV_TMR2_PeriodValueGet ( void ) ;
3911 
3912 void
3913  DRV_TMR2_StopInIdleDisable ( void ) ;
3914 
3915 void
3916  DRV_TMR2_StopInIdleEnable ( void ) ;
3917 
3918 static inline void
3920  {
3921  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
3922  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
3923  hvps_test_67zqendz ( 36 ) ; /* 30 */
3924  }
3925 
3926 uint32_t
3927  DRV_TMR2_CounterFrequencyGet ( void ) ;
3928 
3931  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3932 // *****************************************************************************
3933 // *****************************************************************************
3934 // Section: Interface Headers for Instance 3 for the static driver
3935 // *****************************************************************************
3936 // *****************************************************************************
3937 
3938 void
3939  DRV_TMR3_Initialize ( void ) ;
3940 
3941 bool
3942  DRV_TMR3_Start ( void ) ;
3943 
3944 void
3945  DRV_TMR3_Stop ( void ) ;
3946 
3947 static inline void
3949  {
3950  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
3951  DRV_TMR3_Stop () ;
3952  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
3953  hvps_test_67zqendz ( 38 ) ; /* 30 */
3954  }
3955 
3956 static inline SYS_STATUS
3958 {
3959  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
3960  /* Return the status as ready always */
3961  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
3962  hvps_test_67zqendz ( 40 ) ; /* 30 */
3963  return
3964  SYS_STATUS_READY ;
3965 }
3966 
3967 static inline void
3968  DRV_TMR3_Open ( void )
3969  {
3970  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
3971  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
3972  hvps_test_67zqendz ( 42 ) ; /* 30 */
3973  }
3974 
3976  DRV_TMR3_ClientStatus ( void ) ;
3977 
3978 static inline DRV_TMR_OPERATION_MODE
3980 {
3981  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
3982  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
3983  hvps_test_67zqendz ( 44 ) ; /* 30 */
3984  return
3986 }
3987 
3988 static inline void
3990  {
3991  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
3992  DRV_TMR3_Stop () ;
3993  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
3994  hvps_test_67zqendz ( 46 ) ; /* 30 */
3995  }
3996 
3997 bool
3999  DRV_TMR_CLK_SOURCES clockSource ,
4000  TMR_PRESCALE prescale ) ;
4001 
4002 void
4004  uint32_t value ) ;
4005 
4006 uint32_t
4007  DRV_TMR3_CounterValueGet ( void ) ;
4008 
4009 void
4010  DRV_TMR3_CounterClear ( void ) ;
4011 
4012 TMR_PRESCALE
4013  DRV_TMR3_PrescalerGet ( void ) ;
4014 
4015 void
4017  uint32_t value ) ;
4018 
4019 uint32_t
4020  DRV_TMR3_PeriodValueGet ( void ) ;
4021 
4022 void
4023  DRV_TMR3_StopInIdleDisable ( void ) ;
4024 
4025 void
4026  DRV_TMR3_StopInIdleEnable ( void ) ;
4027 
4028 static inline void
4030  {
4031  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4032  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4033  hvps_test_67zqendz ( 48 ) ; /* 30 */
4034  }
4035 
4036 uint32_t
4037  DRV_TMR3_CounterFrequencyGet ( void ) ;
4038 
4041  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4042 // *****************************************************************************
4043 // *****************************************************************************
4044 // Section: Interface Headers for Instance 4 for the static driver
4045 // *****************************************************************************
4046 // *****************************************************************************
4047 
4048 void
4049  DRV_TMR4_Initialize ( void ) ;
4050 
4051 bool
4052  DRV_TMR4_Start ( void ) ;
4053 
4054 void
4055  DRV_TMR4_Stop ( void ) ;
4056 
4057 static inline void
4059  {
4060  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4061  DRV_TMR4_Stop () ;
4062  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4063  hvps_test_67zqendz ( 50 ) ; /* 30 */
4064  }
4065 
4066 static inline SYS_STATUS
4068 {
4069  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4070  /* Return the status as ready always */
4071  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4072  hvps_test_67zqendz ( 52 ) ; /* 30 */
4073  return
4074  SYS_STATUS_READY ;
4075 }
4076 
4077 static inline void
4078  DRV_TMR4_Open ( void )
4079  {
4080  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4081  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4082  hvps_test_67zqendz ( 54 ) ; /* 30 */
4083  }
4084 
4086  DRV_TMR4_ClientStatus ( void ) ;
4087 
4088 static inline DRV_TMR_OPERATION_MODE
4090 {
4091  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4092  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4093  hvps_test_67zqendz ( 56 ) ; /* 30 */
4094  return
4096 }
4097 
4098 static inline void
4100  {
4101  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4102  DRV_TMR4_Stop () ;
4103  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4104  hvps_test_67zqendz ( 58 ) ; /* 30 */
4105  }
4106 
4107 bool
4109  DRV_TMR_CLK_SOURCES clockSource ,
4110  TMR_PRESCALE prescale ) ;
4111 
4112 void
4114  uint32_t value ) ;
4115 
4116 uint32_t
4117  DRV_TMR4_CounterValueGet ( void ) ;
4118 
4119 void
4120  DRV_TMR4_CounterClear ( void ) ;
4121 
4122 TMR_PRESCALE
4123  DRV_TMR4_PrescalerGet ( void ) ;
4124 
4125 void
4127  uint32_t value ) ;
4128 
4129 uint32_t
4130  DRV_TMR4_PeriodValueGet ( void ) ;
4131 
4132 void
4133  DRV_TMR4_StopInIdleDisable ( void ) ;
4134 
4135 void
4136  DRV_TMR4_StopInIdleEnable ( void ) ;
4137 
4138 static inline void
4140  {
4141  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4142  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4143  hvps_test_67zqendz ( 60 ) ; /* 30 */
4144  }
4145 
4146 uint32_t
4147  DRV_TMR4_CounterFrequencyGet ( void ) ;
4148 
4151  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4152  // #ifndef _DRV_TMR_STATIC_H
4153 /*******************************************************************************
4154  End of File
4155 */
4156 
4157 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4158 /* CLOSE_FILE Include File */
4159 
4160 #include "peripheral/int/plib_int.h"
4161 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4162 /*******************************************************************************
4163  PMP Driver Interface Declarations for Static Single Instance Driver
4164  Company:
4165  Microchip Technology Inc.
4166  File Name:
4167  drv_pmp_static.h
4168  Summary:
4169  PMP driver interface declarations for the static single instance driver.
4170  Description:
4171  The PMP device driver provides a simple interface to manage the PMP
4172  modules on Microchip microcontrollers. This file defines the interface
4173  Declarations for the PMP driver.
4174 
4175  Remarks:
4176  Static interfaces incorporate the driver instance number within the names
4177  of the routines, eliminating the need for an object ID or object handle.
4178 
4179  Static single-open interfaces also eliminate the need for the open handle.
4180 *******************************************************************************/
4181 //DOM-IGNORE-BEGIN
4182 /*******************************************************************************
4183 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4184 Microchip licenses to you the right to use, modify, copy and distribute
4185 Software only when embedded on a Microchip microcontroller or digital signal
4186 controller that is integrated into your product or third party product
4187 (pursuant to the sublicense terms in the accompanying license agreement).
4188 You should refer to the license agreement accompanying this Software for
4189 additional information regarding your rights and obligations.
4190 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4191 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4192 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4193 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4194 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4195 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4196 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4197 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4198 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4199 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4200 *******************************************************************************/
4201 //DOM-IGNORE-END
4202 #ifndef _DRV_PMP_STATIC_H
4203 #define _DRV_PMP_STATIC_H
4204 #include "peripheral/pmp/plib_pmp.h"
4205 // *****************************************************************************
4206 // *****************************************************************************
4207 // Section: Interface Headers for Instance 0 for the static driver
4208 // *****************************************************************************
4209 // *****************************************************************************
4210 
4211 void
4212  DRV_PMP0_Initialize ( void ) ;
4213 
4214 void
4215  DRV_PMP0_ModeConfig ( void ) ;
4216 
4217 void
4219  PMP_DATA_WAIT_STATES dataWait ,
4220  PMP_STROBE_WAIT_STATES strobeWait ,
4221  PMP_DATA_HOLD_STATES dataHold ) ;
4222 
4223 uint8_t
4224  DRV_PMP0_Read ( void ) ;
4225 
4226 void
4227  DRV_PMP0_Write (
4228  uint8_t data ) ;
4229  // #ifndef _DRV_PMP_STATIC_H
4230 /*******************************************************************************
4231  End of File
4232 */
4233 
4234 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4235 /* CLOSE_FILE Include File */
4236 
4237 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4238 /*******************************************************************************
4239  USART Driver Interface Declarations for Static Single Instance Driver
4240  Company:
4241  Microchip Technology Inc.
4242  File Name:
4243  drv_usart_static.h
4244  Summary:
4245  USART driver interface declarations for the static single instance driver.
4246  Description:
4247  The USART device driver provides a simple interface to manage the USART
4248  modules on Microchip microcontrollers. This file defines the interface
4249  Declarations for the USART static driver.
4250  Remarks:
4251  Static interfaces incorporate the driver instance number within the names
4252  of the routines, eliminating the need for an object ID or object handle.
4253  Static single-open interfaces also eliminate the need for the open handle.
4254 *******************************************************************************/
4255 //DOM-IGNORE-BEGIN
4256 /*******************************************************************************
4257 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4258 Microchip licenses to you the right to use, modify, copy and distribute
4259 Software only when embedded on a Microchip microcontroller or digital signal
4260 controller that is integrated into your product or third party product
4261 (pursuant to the sublicense terms in the accompanying license agreement).
4262 You should refer to the license agreement accompanying this Software for
4263 additional information regarding your rights and obligations.
4264 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4265 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4266 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4267 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4268 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4269 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4270 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4271 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4272 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4273 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4274 *******************************************************************************/
4275 //DOM-IGNORE-END
4276 #ifndef _DRV_USART_STATIC_H
4277 #define _DRV_USART_STATIC_H
4278 // *****************************************************************************
4279 // *****************************************************************************
4280 // Section: Included Files
4281 // *****************************************************************************
4282 // *****************************************************************************
4283 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4284 /*******************************************************************************
4285  USART Driver Local Data Structures for static implementation
4286  Company:
4287  Microchip Technology Inc.
4288  File Name:
4289  drv_usart_static_local.h
4290  Summary:
4291  USART Driver Local Data Structures for static implementation
4292  Description:
4293  Driver Local Data Structures for static implementation
4294 *******************************************************************************/
4295 //DOM-IGNORE-BEGIN
4296 /*******************************************************************************
4297 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4298 Microchip licenses to you the right to use, modify, copy and distribute Software
4299 only when embedded on a Microchip microcontroller or digital signal controller
4300 that is integrated into your product or third party product (pursuant to the
4301 sublicense terms in the accompanying license agreement).
4302 You should refer to the license agreement accompanying this Software for
4303 additional information regarding your rights and obligations.
4304 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4305 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4306 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4307 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4308 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4309 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4310 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4311 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4312 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4313 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4314 *******************************************************************************/
4315 //DOM-IGNORE-END
4316 #ifndef _DRV_USART_STATIC_LOCAL_H
4317 #define _DRV_USART_STATIC_LOCAL_H
4318 // *****************************************************************************
4319 // *****************************************************************************
4320 // Section: Included Files
4321 // *****************************************************************************
4322 // *****************************************************************************
4323 #include <stdint.h>
4324 #include <stdbool.h>
4325 #include <stddef.h>
4326 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4327 /*******************************************************************************
4328  USART Driver Interface Header File
4329  Company:
4330  Microchip Technology Inc.
4331  File Name:
4332  drv_usart.h
4333  Summary:
4334  USART Driver Interface Header File
4335  Description:
4336  The USART device driver provides a simple interface to manage the USART or
4337  UART modules on Microchip microcontrollers. This file provides the
4338  interface definition for the USART driver.
4339 *******************************************************************************/
4340 //DOM-IGNORE-BEGIN
4341 /*******************************************************************************
4342 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4343 Microchip licenses to you the right to use, modify, copy and distribute
4344 Software only when embedded on a Microchip microcontroller or digital signal
4345 controller that is integrated into your product or third party product
4346 (pursuant to the sublicense terms in the accompanying license agreement).
4347 You should refer to the license agreement accompanying this Software for
4348 additional information regarding your rights and obligations.
4349 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4350 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4351 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4352 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4353 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4354 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4355 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4356 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4357 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4358 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4359 *******************************************************************************/
4360 //DOM-IGNORE-END
4361 #ifndef _DRV_USART_H
4362 #define _DRV_USART_H
4363 // *****************************************************************************
4364 // *****************************************************************************
4365 // Section: File includes
4366 // *****************************************************************************
4367 // *****************************************************************************
4368 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4369 /*******************************************************************************
4370  USART Driver Definitions Header File
4371  Company:
4372  Microchip Technology Inc.
4373  File Name:
4374  drv_usart_definitions.h
4375  Summary:
4376  USART Driver Definitions Header File
4377  Description:
4378  This file will provide enumerations and other dependencies needed by
4379  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4380 *******************************************************************************/
4381 //DOM-IGNORE-BEGIN
4382 /*******************************************************************************
4383 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4384 Microchip licenses to you the right to use, modify, copy and distribute
4385 Software only when embedded on a Microchip microcontroller or digital signal
4386 controller that is integrated into your product or third party product
4387 (pursuant to the sublicense terms in the accompanying license agreement).
4388 You should refer to the license agreement accompanying this Software for
4389 additional information regarding your rights and obligations.
4390 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4391 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4392 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4393 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4394 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4395 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4396 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4397 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4398 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4399 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4400 *******************************************************************************/
4401 //DOM-IGNORE-END
4402 #ifndef _DRV_USART_DEFINITIONS_H
4403 #define _DRV_USART_DEFINITIONS_H
4404 // *****************************************************************************
4405 // *****************************************************************************
4406 // Section: File includes
4407 // *****************************************************************************
4408 // *****************************************************************************
4409 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4410 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4411 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4412 /*******************************************************************************
4413  USART Peripheral Library Interface Header
4414  Company:
4415  Microchip Technology Inc.
4416  File Name:
4417  plib_usart.h
4418  Summary:
4419  USART Peripheral Library interface header.
4420  Description:
4421  This header file contains the function prototypes and definitions of
4422  the data types and constants that make up the interface to the USART
4423  Peripheral Library for all families of Microchip microcontrollers. The
4424  functions in this file are common to the USART module.
4425  *******************************************************************************/
4426 // DOM-IGNORE-BEGIN
4427 /*******************************************************************************
4428 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4429 Microchip licenses to you the right to use, modify, copy and distribute
4430 Software only when embedded on a Microchip microcontroller or digital signal
4431 controller that is integrated into your product or third party product
4432 (pursuant to the sublicense terms in the accompanying license agreement).
4433 You should refer to the license agreement accompanying this Software for
4434 additional information regarding your rights and obligations.
4435 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4436 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4437 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4438 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4439 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4440 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4441 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4442 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4443 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4444 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4445  *******************************************************************************/
4446 // DOM-IGNORE-END
4447 #ifndef _PLIB_USART_H
4448 #define _PLIB_USART_H
4449 // DOM-IGNORE-BEGIN
4450 // DOM-IGNORE-END
4451 // ****************************************************************************
4452 // ****************************************************************************
4453 // Section: Included Files
4454 // ****************************************************************************
4455 // ****************************************************************************
4456 /* This section lists the other files that are included in this file.
4457 */
4458 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4459 /*******************************************************************************
4460  Processor Selector File for the USART
4461  Company:
4462  Microchip Technology Incorporated
4463  File Name:
4464  processor.h
4465  Summary:
4466  Selects the appropriate header for the part family
4467  Description:
4468  This file selects the appropriate header for the part family
4469  *******************************************************************************/
4470 // DOM-IGNORE-BEGIN
4471 /*******************************************************************************
4472 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4473 Microchip licenses to you the right to use, modify, copy and distribute
4474 Software only when embedded on a Microchip microcontroller or digital signal
4475 controller that is integrated into your product or third party product
4476 (pursuant to the sublicense terms in the accompanying license agreement).
4477 You should refer to the license agreement accompanying this Software for
4478 additional information regarding your rights and obligations.
4479 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4480 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4481 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4482 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4483 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4484 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4485 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4486 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4487 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4488 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4489  *******************************************************************************/
4490 // DOM-IGNORE-END
4491 #ifndef _USART_PROCESSOR_H
4492 #define _USART_PROCESSOR_H
4493 // *****************************************************************************
4494 // *****************************************************************************
4495 // Section: Included Files
4496 // *****************************************************************************
4497 // *****************************************************************************
4498 /* This section lists the other files that are included in this file.
4499  */
4500 #include <stdint.h>
4501 #include <stdbool.h>
4502 #error "No Processor Family specified"
4503  //
4504  // _USART_PROCESSOR_H
4505 /*******************************************************************************
4506  End of File
4507  */
4508 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4509 /* CLOSE_FILE Include File */
4510 
4511 // ****************************************************************************
4512 // ****************************************************************************
4513 // Section: USART Peripheral Library Interface Functions
4514 // ****************************************************************************
4515 // ****************************************************************************
4516 //******************************************************************************
4517 /* Function:
4518  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4519  Summary:
4520  Enables the USART module to continue to operate when an overflow error
4521  condition has occurred.
4522  Description:
4523  This function enables the USART module to continue to operate when an
4524  overflow error condition has occurred.
4525  This operation is atomic.
4526  Precondition:
4527  None.
4528  Parameters:
4529  index - Identifier for the device instance to be configured
4530  Returns:
4531  None.
4532  Example:
4533  <code>
4534 #define MY_USART_INSTANCE USART_ID_1
4535  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4536  </code>
4537  Remarks:
4538  This feature may not be available on all devices. Please refer to the
4539  specific device data sheet to determine availability or use
4540  PLIB_USART_ExistsRunInOverflow in your application to determine
4541  whether this feature is available.
4542 */
4543 
4544 void
4546  USART_MODULE_ID index ) ;
4547 //******************************************************************************
4548 /* Function:
4549  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
4550  Summary:
4551  Disables the Run in overflow condition mode.
4552  Description:
4553  This function disables the USART module from accepting new data when an overflow
4554  error condition is detected.
4555  This operation is atomic.
4556  Precondition:
4557  None.
4558  Parameters:
4559  index - Identifier for the device instance to be configured
4560  Returns:
4561  None.
4562  Example:
4563  <code>
4564 #define MY_USART_INSTANCE USART_ID_1
4565  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
4566  </code>
4567  Remarks:
4568  This feature may not be available on all devices. Please refer to the
4569  specific device data sheet to determine availability or use
4570  PLIB_USART_ExistsRunInOverflow in your application to determine
4571  whether this feature is available.
4572 */
4573 
4574 void
4576  USART_MODULE_ID index ) ;
4577 //******************************************************************************
4578 /* Function:
4579  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
4580  Summary:
4581  Gets the status of the Run in Overflow condition.
4582  Description:
4583  This function indicates if the USART module has been enabled to run in
4584  an overflow condition.
4585  This operation is atomic.
4586  Precondition:
4587  None.
4588  Parameters:
4589  index - Identifier for the device instance
4590  Returns:
4591  - true - Run in overflow condition is enabled
4592  - false - Run in overflow condition is disabled
4593  Example:
4594  <code>
4595 #define MY_USART_INSTANCE USART_ID_1
4596  bool status;
4597  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
4598  </code>
4599  Remarks:
4600  This feature may not be available on all devices. Please refer to the
4601  specific device data sheet to determine availability or use
4602  PLIB_USART_ExistsRunInOverflow in your application to determine
4603  whether this feature is available.
4604 */
4605 
4606 bool
4608  USART_MODULE_ID index ) ;
4609 //******************************************************************************
4610 /* Function:
4611  void PLIB_USART_BRGClockSourceSelect
4612  (
4613  USART_MODULE_ID index,
4614  USART_BRG_CLOCK_SOURCE brgClockSource
4615  )
4616  Summary:
4617  Configures the BRG clock source of the USART module.
4618  Description:
4619  This function configures the BRG Clock source of the USART. Refer to
4620  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4621  Precondition:
4622  None.
4623  Parameters:
4624  index - Identifier for the device instance to be configured
4625  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
4626  Returns:
4627  None.
4628  Example:
4629  <code>
4630 #define MY_USART_INSTANCE USART_ID_1
4631  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
4632  </code>
4633  Remarks:
4634  This feature may not be available on all devices. Please refer to the
4635  specific device data sheet to determine availability or use
4636  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4637  whether this feature is available.
4638 */
4639 
4640 void
4642  USART_MODULE_ID index ,
4643  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
4644 //******************************************************************************
4645 /* Function:
4646  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
4647  Summary:
4648  Gets the BRG clock source of the USART module.
4649  Description:
4650  This function returns the BRG Clock source of the USART. Refer to
4651  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4652  This operation is atomic.
4653  Precondition:
4654  None.
4655  Parameters:
4656  index - Identifier for the device instance
4657  Returns:
4658  One of the possible values of USART_BRG_CLOCK_SOURCE
4659  Example:
4660  <code>
4661 #define MY_USART_INSTANCE USART_ID_1
4662  USART_BRG_CLOCK_SOURCE brgClockSource;
4663  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
4664  </code>
4665  Remarks:
4666  This feature may not be available on all devices. Please refer to the
4667  specific device data sheet to determine availability or use
4668  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4669  whether this feature is available.
4670 */
4671 
4672 USART_BRG_CLOCK_SOURCE
4674  USART_MODULE_ID index ) ;
4675 //******************************************************************************
4676 /* Function:
4677  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
4678  Summary:
4679  Returns the USART module's running status.
4680  Description:
4681  This function checks if the USART module status is busy. The following
4682  functions should not be used when the module status is busy:
4683  - PLIB_USART_LineControlModeSelect
4684  - PLIB_USART_BaudRateHighSet
4685  - PLIB_USART_BaudRateHighEnable
4686  - PLIB_USART_BaudRateHighDisable
4687  - PLIB_USART_ReceiverIdleStateLowEnable
4688  - PLIB_USART_ReceiverIdleStateLowDisable
4689  - PLIB_USART_BaudRateAutoDetectEnable
4690  - PLIB_USART_LoopbackEnable
4691  - PLIB_USART_LoopbackDisable
4692  - PLIB_USART_WakeOnStartEnable
4693  - PLIB_USART_WakeOnStartDisable
4694  - PLIB_USART_OperationModeSelect
4695  - PLIB_USART_HandshakeModeSelect
4696  - PLIB_USART_IrDAEnable
4697  - PLIB_USART_IrDADisable
4698  - PLIB_USART_StopInIdleEnable
4699  - PLIB_USART_StopInIdleDisable
4700  - PLIB_USART_RunInOverflowEnable
4701  - PLIB_USART_RunInOverflowDisable
4702  - PLIB_USART_BRGClockSourceSelect
4703  - PLIB_USART_RunInSleepModeEnable
4704  - PLIB_USART_RunInSleepModeDisable
4705  This operation is atomic.
4706  Precondition:
4707  None.
4708  Parameters:
4709  index - Identifier for the device instance
4710  Returns:
4711  - true - USART module is busy
4712  - false - USART module is idle
4713  Example:
4714  <code>
4715 #define MY_USART_INSTANCE USART_ID_1
4716  bool moduleStatus;
4717  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
4718  </code>
4719  Remarks:
4720  This feature may not be available on all devices. Please refer to the
4721  specific device data sheet to determine availability or use
4722  PLIB_USART_ExistsModuleBusyStatus in your application to determine
4723  whether this feature is available.
4724 */
4725 
4726 bool
4728  USART_MODULE_ID index ) ;
4729 //******************************************************************************
4730 /* Function:
4731  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
4732  Summary:
4733  Allows the USART module's BRG clock to run when the device enters Sleep mode.
4734  Description:
4735  This function enables the USART module's BRG clock to continue operation when
4736  the device enters the Sleep mode.
4737  This operation is atomic.
4738  Precondition:
4739  None.
4740  Parameters:
4741  index - Identifier for the device instance to be configured
4742  Returns:
4743  None.
4744  Example:
4745  <code>
4746 #define MY_USART_INSTANCE USART_ID_1
4747  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
4748  </code>
4749  Remarks:
4750  This feature may not be available on all devices. Please refer to the
4751  specific device data sheet to determine availability or use
4752  PLIB_USART_ExistsRunInSleepMode in your application to determine
4753  whether this feature is available.
4754 */
4755 
4756 void
4758  USART_MODULE_ID index ) ;
4759 //******************************************************************************
4760 /* Function:
4761  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
4762  Summary:
4763  Turns off the USART module's BRG clock during Sleep mode.
4764  Description:
4765  This function turns off the USART module's BRG clock during Sleep mode.
4766  This operation is atomic.
4767  Precondition:
4768  None.
4769  Parameters:
4770  index - Identifier for the device instance to be configured
4771  Returns:
4772  None.
4773  Example:
4774  <code>
4775 #define MY_USART_INSTANCE USART_ID_1
4776  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
4777  </code>
4778  Remarks:
4779  This feature may not be available on all devices. Please refer to the
4780  specific device data sheet to determine availability or use
4781  PLIB_USART_ExistsRunInSleepMode in your application to determine
4782  whether this feature is available.
4783 */
4784 
4785 void
4787  USART_MODULE_ID index ) ;
4788 //******************************************************************************
4789 /* Function:
4790  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
4791  Summary:
4792  Gets the status of Run in Sleep mode.
4793  Description:
4794  This function indicates if the USART module has been enabled to run in
4795  Sleep mode.
4796  This operation is atomic.
4797  Precondition:
4798  None.
4799  Parameters:
4800  index - Identifier for the device instance
4801  Returns:
4802  - true - Run in Sleep mode is enabled
4803  - false - Run in Sleep mode is disabled
4804  Example:
4805  <code>
4806 #define MY_USART_INSTANCE USART_ID_1
4807  bool status;
4808  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
4809  </code>
4810  Remarks:
4811  This feature may not be available on all devices. Please refer to the
4812  specific device data sheet to determine availability or use
4813  PLIB_USART_ExistsRunInSleepMode in your application to determine
4814  whether this feature is available.
4815 */
4816 
4817 bool
4819  USART_MODULE_ID index ) ;
4820 //******************************************************************************
4821 /* Function:
4822  void PLIB_USART_Enable ( USART_MODULE_ID index )
4823  Summary:
4824  Enables the specific USART module.
4825  Description:
4826  This function enables the specific USART module.
4827  This operation is atomic.
4828  Precondition:
4829  None.
4830  Parameters:
4831  index - Identifier for the device instance to be configured
4832  Returns:
4833  None.
4834  Example:
4835  <code>
4836 #define MY_USART_INSTANCE USART_ID_1
4837  PLIB_USART_Enable(MY_USART_INSTANCE);
4838  </code>
4839  Remarks:
4840  By calling this function, the USART pins are controlled by the USART
4841  module.
4842  This feature may not be available on all devices. Please refer to the
4843  specific device data sheet to determine availability or use
4844  PLIB_USART_ExistsEnable in your application to determine whether
4845  this feature is available.
4846 */
4847 
4848 void
4850  USART_MODULE_ID index ) ;
4851 //******************************************************************************
4852 /* Function:
4853  void PLIB_USART_Disable ( USART_MODULE_ID index )
4854  Summary:
4855  Disables the specific USART module
4856  Description:
4857  This function disables the specific USART module.
4858  This operation is atomic.
4859  Precondition:
4860  None.
4861  Parameters:
4862  index - Identifier for the device instance to be configured
4863  Returns:
4864  None.
4865  Example:
4866  <code>
4867 #define MY_USART_INSTANCE USART_ID_1
4868  PLIB_USART_Disable(MY_USART_INSTANCE);
4869  </code>
4870  Remarks:
4871  The default state after any reset for a USART module is the disable state.
4872  If the USART is disabled, all of the related pins are in control of the
4873  general purpose I/O logic.
4874 
4875  Disabling the USART module resets the buffers to empty states. Any data
4876  characters in the buffers are lost and the baud rate is reset. All error
4877  and status bits are also reset.
4878 
4879  Disabling the USART while the USART is active, will abort all pending
4880  transmissions and receptions. Re-enabling the USART will restart the
4881  module in the same configuration.
4882 
4883  When disabled, the USART power consumption is minimal.
4884  This feature may not be available on all devices. Please refer to the
4885  specific device data sheet to determine availability or use
4886  PLIB_USART_ExistsEnable in your application to determine whether
4887  this feature is available.
4888 */
4889 
4890 void
4892  USART_MODULE_ID index ) ;
4893 //******************************************************************************
4894 /* Function:
4895  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
4896  Summary:
4897  Enables the specific USART module transmitter.
4898  Description:
4899  This function enables the specific USART module transmitter.
4900  This operation is atomic.
4901  Precondition:
4902  The USART module should be enabled using the function PLIB_USART_Enable
4903  before this function is called.
4904  Parameters:
4905  index - Identifier for the device instance to be configured
4906  Returns:
4907  None.
4908  Example:
4909  <code>
4910 #define MY_USART_INSTANCE USART_ID_1
4911  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
4912  </code>
4913  Remarks:
4914  The transmitter should not be enabled until the USART is enabled.
4915  The transmissions will not be enabled otherwise.
4916 
4917  This feature may not be available on all devices. Please refer to the
4918  specific device data sheet to determine availability or use
4919  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4920  this feature is available.
4921 */
4922 
4923 void
4925  USART_MODULE_ID index ) ;
4926 //******************************************************************************
4927 /* Function:
4928  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
4929  Summary:
4930  Disables the specific USART module transmitter.
4931  Description:
4932  This function disables the specific USART module transmitter.
4933  This operation is atomic.
4934  Precondition:
4935  None.
4936  Parameters:
4937  index - Identifier for the device instance to be configured
4938  Returns:
4939  None.
4940  Example:
4941  <code>
4942 #define MY_USART_INSTANCE USART_ID_1
4943  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
4944  </code>
4945  Remarks:
4946  Disabling the transmitter during a transmission will cause the
4947  transmission to be aborted.
4948 
4949  This feature may not be available on all devices. Please refer to the
4950  specific device data sheet to determine availability or use
4951  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4952  this feature is available.
4953 */
4954 
4955 void
4957  USART_MODULE_ID index ) ;
4958 //******************************************************************************
4959 /* Function:
4960  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
4961  uint32_t baudRate );
4962  Summary:
4963  Sets the baud rate to the desired value.
4964  Description:
4965  This function sets the baud rate to the desired value.
4966  Precondition:
4967  None.
4968  Parameters:
4969  index - Identifier for the device instance to be configured
4970  baudRate - Baud Rate Value
4971  clockFrequency - Clock Frequency
4972  Returns:
4973  None.
4974  Example:
4975  <code>
4976 #define MY_USART_INSTANCE USART_ID_1
4977  uint32_t baudRateValue ;
4978  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
4979  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
4980  </code>
4981  Remarks:
4982  Setting a new baud rate value causes the baud rate timer to reset.
4983  This ensures that the baud rate timer does not have to overflow before
4984  outputting the new baud rate.
4985 
4986  If the system clock is changed during an active receive operation, a
4987  receiver error or data loss may result. To avoid this issue verify that
4988  no receptions are in progress before changing the system clock.
4989 
4990  This feature may not be available on all devices. Please refer to the
4991  specific device data sheet to determine availability or use
4992  PLIB_USART_ExistsBaudRate in your application to determine whether
4993  this feature is available.
4994 */
4995 
4996 void
4998  USART_MODULE_ID index ,
4999  uint32_t clockFrequency ,
5000  uint32_t baudRate ) ;
5001 //******************************************************************************
5002 /* Function:
5003  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
5004  uint32_t clockFrequency, uint32_t baudRate );
5005  Summary:
5006  Sets the baud rate to the desired value.
5007  Description:
5008  This function sets the baud rate to the desired value.
5009  Precondition:
5010  None.
5011  Parameters:
5012  index - Identifier for the device instance to be configured
5013  baudRate - Baud Rate Value, it is the baud rate value
5014  clockFrequency - Clock Frequency
5015  Returns:
5016  None.
5017  Example:
5018  <code>
5019 #define MY_USART_INSTANCE USART_ID_1
5020  uint32_t baudRateValue ;
5021  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5022  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5023  </code>
5024  Remarks:
5025  Setting a new baud rate value causes the baud rate timer to reset.
5026  This ensures that the baud rate timer does not have to overflow before
5027  outputting the new baud rate.
5028 
5029  If the system clock is changed during an active receive operation, a
5030  receiver error or data loss may result. To avoid this issue verify that
5031  no receptions are in progress before changing the system clock.
5032 
5033  This feature may not be available on all devices. Please refer to the
5034  specific device data sheet to determine availability or use
5035  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5036  this feature is available.
5037 */
5038 
5039 void
5041  USART_MODULE_ID index ,
5042  uint32_t clockFrequency ,
5043  uint32_t baudRate ) ;
5044 //******************************************************************************
5045 /* Function:
5046  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5047  int32_t clockFrequency );
5048  Summary:
5049  Gets the baud rate current in use.
5050  Description:
5051  This function gets the baud rate that is currently in use. The clock frequency
5052  needs to be passed to the function.
5053  Conditions:
5054  None.
5055  Input:
5056  index - Identifier for the device instance to be configured
5057  clockFrequency - Clock Frequency
5058  Returns:
5059  - BaudRate - Baud rate value
5060  Example:
5061  <code>
5062 #define MY_USART_INSTANCE USART_ID_1
5063  uint32_t baudRate ;
5064  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5065  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5066  </code>
5067  Remarks:
5068  This feature may not be available on all devices. Please refer to the
5069  specific device data sheet to determine availability or use
5070  PLIB_USART_ExistsBaudRate in your application to determine whether
5071  this feature is available.
5072 */
5073 
5074 uint32_t
5076  USART_MODULE_ID index ,
5077  int32_t clockFrequency ) ;
5078 //******************************************************************************
5079 /* Function:
5080  void PLIB_USART_AddressSet
5081  (
5082  USART_MODULE_ID index,
5083  uint8_t address
5084  )
5085  Summary:
5086  Sets the address for the Address Detect mode.
5087  Description:
5088  This function sets the address for the Address Detect mode.
5089  This operation is atomic.
5090  Precondition:
5091  None.
5092  Parameters:
5093  index - Identifier for the device instance to be configured
5094  address - Address
5095  Returns:
5096  None.
5097  Example:
5098  <code>
5099 #define MY_USART_INSTANCE USART_ID_1
5100  uint8_t address = 0x02;
5101  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5102  </code>
5103  Remarks:
5104  This feature may not be available on all devices. Please refer to the
5105  specific device data sheet to determine availability or use
5106  PLIB_USART_ExistsReceiverAddress in your application to determine
5107  whether this feature is available.
5108 */
5109 
5110 void
5112  USART_MODULE_ID index ,
5113  uint8_t address ) ;
5114 //******************************************************************************
5115 /* Function:
5116  uint8_t PLIB_USART_AddressGet
5117  (
5118  USART_MODULE_ID index
5119  )
5120  Summary:
5121  Gets the address for the Address Detect mode.
5122  Description:
5123  This function returns the address value being used for the Address
5124  Detect mode.
5125  This operation is atomic.
5126  Precondition:
5127  None.
5128  Parameters:
5129  index - Identifier for the device instance
5130  Returns:
5131  - address - The address being used
5132  Example:
5133  <code>
5134 #define MY_USART_INSTANCE USART_ID_1
5135  uint8_t address = 0;
5136  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5137  </code>
5138  Remarks:
5139  This feature may not be available on all devices. Please refer to the
5140  specific device data sheet to determine availability or use
5141  PLIB_USART_ExistsReceiverAddress in your application to determine
5142  whether this feature is available.
5143 */
5144 
5145 uint8_t
5147  USART_MODULE_ID index ) ;
5148 //******************************************************************************
5149 /* Function:
5150  void PLIB_USART_AddressMaskSet
5151  (
5152  USART_MODULE_ID index,
5153  uint8_t mask
5154  )
5155  Summary:
5156  Sets the address mask for the Address Detect mode.
5157  Description:
5158  This function sets the address mask for the Address Detect mode.
5159  This operation is atomic.
5160  Precondition:
5161  None.
5162  Parameters:
5163  index - Identifier for the device instance to be configured
5164  mask - Address match mask bits
5165  Returns:
5166  None.
5167  Example:
5168  <code>
5169 #define MY_USART_INSTANCE USART_ID_1
5170  uint8_t mask = 0x0F;
5171  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5172  </code>
5173  Remarks:
5174  This feature may not be available on all devices. Please refer to the
5175  specific device data sheet to determine availability or use
5176  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5177  whether this feature is available.
5178 */
5179 
5180 void
5182  USART_MODULE_ID index ,
5183  uint8_t mask ) ;
5184 //******************************************************************************
5185 /* Function:
5186  uint8_t PLIB_USART_AddressMaskGet
5187  (
5188  USART_MODULE_ID index
5189  )
5190  Summary:
5191  Gets the address mask for the Address Detect mode.
5192  Description:
5193  This function returns the address mask value being used for the Address
5194  Detect mode.
5195  This operation is atomic.
5196  Precondition:
5197  None.
5198  Parameters:
5199  index - Identifier for the device instance to be configured
5200  Returns:
5201  - mask - Address mask being used
5202  Example:
5203  <code>
5204 #define MY_USART_INSTANCE USART_ID_1
5205  uint8_t mask = 0;
5206  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5207  </code>
5208  Remarks:
5209  This feature may not be available on all devices. Please refer to the
5210  specific device data sheet to determine availability or use
5211  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5212  whether this feature is available.
5213 */
5214 
5215 uint8_t
5217  USART_MODULE_ID index ) ;
5218 //******************************************************************************
5219 /* Function:
5220  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5221  Summary:
5222  Enables the Address Detect mode.
5223  Description:
5224  This function enables the Address Detect mode. If it is enabled, and the
5225  device is addressed, disable the Address Detect mode to continue receiving
5226  bytes.
5227  This operation is atomic.
5228  Precondition:
5229  None.
5230  Parameters:
5231  index - Identifier for the device instance to be configured
5232  Returns:
5233  None.
5234  Example:
5235  <code>
5236 #define MY_USART_INSTANCE USART_ID_1
5237  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5238  </code>
5239  Remarks:
5240  If 9 data bits are not selected, this bit has no effect.
5241  This feature may not be available on all devices. Please refer to the
5242  specific device data sheet to determine availability or use
5243  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5244  this feature is available.
5245 */
5246 
5247 void
5249  USART_MODULE_ID index ) ;
5250 //******************************************************************************
5251 /* Function:
5252  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5253  Summary:
5254  Enables the Address Detect mode.
5255  Description:
5256  This function disables the Address Detect mode. If it is enabled, and the
5257  device is addressed, disable the Address Detect mode to continue receiving
5258  bytes.
5259  This operation is atomic.
5260  Precondition:
5261  None.
5262  Parameters:
5263  index - Identifier for the device instance to be configured
5264  Returns:
5265  None.
5266  Example:
5267  <code>
5268 #define MY_USART_INSTANCE USART_ID_1
5269  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5270  </code>
5271  Remarks:
5272  All bytes are received, and the 9th bit can be used as the parity bit.
5273  By default, the address detect is disabled.
5274 
5275  This feature may not be available on all devices. Please refer to the
5276  specific device data sheet to determine availability or use
5277  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5278  this feature is available.
5279 */
5280 
5281 void
5283  USART_MODULE_ID index ) ;
5284 //******************************************************************************
5285 /* Function:
5286  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5287  Summary:
5288  Gets the state of the automatic baud detection.
5289  Description:
5290  This function gets the state of the automatic baud detection and returns a '0'
5291  if the baud rate auto detection is complete.
5292  This operation is atomic.
5293  Precondition:
5294  None.
5295  Parameters:
5296  index - Identifier for the device instance to be configured
5297  Returns:
5298  - true - Baud rate detection is not complete
5299  - false - Baud rate detection is complete
5300  Example:
5301  <code>
5302 #define MY_USART_INSTANCE USART_ID_1
5303  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5304  // Wait until the baud rate is detected.
5305  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5306  </code>
5307  Remarks:
5308  This feature may not be available on all devices. Please refer to the
5309  specific device data sheet to determine availability or use
5310  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5311  this feature is available.
5312 */
5313 
5314 bool
5316  USART_MODULE_ID index ) ;
5317 //******************************************************************************
5318 /* Function:
5319  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5320  Summary:
5321  Enables baud rate measurement on the next character, which requires reception
5322  of the Sync character.
5323  Description:
5324  This function enables the baud rate measurement on the next character,
5325  which requires reception of the Sync character.
5326  This operation is atomic.
5327  Precondition:
5328  None.
5329  Parameters:
5330  index - Identifier for the device instance to be configured
5331  Returns:
5332  None.
5333  Example:
5334  <code>
5335 #define MY_USART_INSTANCE USART_ID_1
5336  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5337  // Wait until the baud rate is detected.
5338  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5339  </code>
5340  Remarks:
5341  This feature may not be available on all devices. Please refer to the
5342  specific device data sheet to determine availability or use
5343  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5344  this feature is available.
5345 */
5346 
5347 void
5349  USART_MODULE_ID index ) ;
5350 //******************************************************************************
5351 /* Function:
5352  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5353  Summary:
5354  Data to be transmitted in the Byte mode.
5355  Description:
5356  The data is transmitted in the Byte mode for the specified USART module.
5357  This operation is atomic.
5358  Precondition:
5359  None.
5360  Parameters:
5361  index - Identifier for the device instance to be configured
5362  data - Data to be transmitted.
5363  Returns:
5364  None.
5365  Example:
5366  <code>
5367 #define MY_USART_INSTANCE USART_ID_1
5368  uint8_t data = 'a';
5369  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5370  {
5371  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5372  }
5373  </code>
5374  Remarks:
5375  This feature may not be available on all devices. Please refer to the
5376  specific device data sheet to determine availability or use
5377  PLIB_USART_ExistsTransmitter in your application to determine whether
5378  this feature is available.
5379 */
5380 
5381 void
5383  USART_MODULE_ID index ,
5384  int8_t data ) ;
5385 //******************************************************************************
5386 /* Function:
5387  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5388  Summary:
5389  Data to be received in the Byte mode.
5390  Description:
5391  The data to be received in Byte mode from the specified USART module.
5392  This operation is atomic.
5393  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5394  PLIB_USART_ReceiverParityErrorHasOccurred and
5395  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5396  Precondition:
5397  None.
5398  Parameters:
5399  index - Identifier for the device instance to be configured
5400  Returns:
5401  - data - Data to be received
5402  Example:
5403  <code>
5404 #define MY_USART_INSTANCE USART_ID_1
5405  bool isError;
5406  uint8_t mydata;
5407  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5408  {
5409  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5410  }
5411  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5412  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5413  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5414  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5415  {
5416  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5417  }
5418  </code>
5419  Remarks:
5420  This feature may not be available on all devices. Please refer to the
5421  specific device data sheet to determine availability or use
5422  PLIB_USART_ExistsReceiver in your application to determine whether
5423  this feature is available.
5424 */
5425 
5426 int8_t
5428  USART_MODULE_ID index ) ;
5429 //******************************************************************************
5430 /* Function:
5431  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5432  Summary:
5433  Data to be received in the byte mode with the 9th bit.
5434  Description:
5435  The data to be received in Byte mode from the specified USART module.
5436  with the 9th bit.
5437  This operation is atomic.
5438  Precondition:
5439  None.
5440  Parameters:
5441  index - Identifier for the device instance to be configured
5442  Returns:
5443  - data - Data to be received
5444  Example:
5445  <code>
5446 #define MY_USART_INSTANCE USART_ID_1
5447  uint16_t mydata;
5448  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5449  {
5450  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5451  }
5452  </code>
5453  Remarks:
5454  This feature may not be available on all devices. Please refer to the
5455  specific device data sheet to determine availability or use
5456  PLIB_USART_ExistsReceiver9Bits in your application to determine
5457  whether this feature is available.
5458 */
5459 
5460 int16_t
5462  USART_MODULE_ID index ) ;
5463 //******************************************************************************
5464 /* Function:
5465  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5466  Summary:
5467  Checks and return if the data received is an address.
5468  Description:
5469  Checks and return if the data received is an address. The address has
5470  the 9th bit set. If data received has the 9th bit set, the function returns true;
5471  otherwise, the function returns false.
5472  This operation is atomic.
5473  Precondition:
5474  The USART module should be configured to use the 9 data bits.
5475  Parameters:
5476  index - Identifier for the device instance to be configured
5477  Returns:
5478  - true - if the data received has the 9th bit set
5479  - false - if the address received has the 9th bit cleared
5480  Example:
5481  <code>
5482 #define MY_USART_INSTANCE USART_ID_1
5483  int8_t address;
5484  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5485  {
5486  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5487  }
5488  </code>
5489  Remarks:
5490  This feature may not be available on all devices. Please refer to the
5491  specific device data sheet to determine availability or use
5492  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5493  this feature is available.
5494 */
5495 
5496 bool
5498  USART_MODULE_ID index ) ;
5499 //******************************************************************************
5500 /* Function:
5501  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5502  int8_t data, bool 9thBit )
5503  Summary:
5504  Data to be transmitted in the byte mode with the 9th bit.
5505  Description:
5506  The data is transmitted in the byte mode for the specified USART module,
5507  with 9th bit.
5508  This operation is atomic.
5509  Precondition:
5510  The USART module should be configured to use the 9 data bits.
5511  Parameters:
5512  index - Identifier for the device instance to be configured
5513  data - Data to be transmitted.
5514  9thBit - 9th bit of the data to be transmitted.
5515  Returns:
5516  None.
5517  Example:
5518  <code>
5519 #define MY_USART_INSTANCE USART_ID_1
5520  uint8_t data = 'a';
5521  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5522  {
5523  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5524  }
5525  </code>
5526  Remarks:
5527  This feature may not be available on all devices. Please refer to the
5528  specific device data sheet to determine availability or use
5529  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5530  this feature is available.
5531 */
5532 
5533 void
5535  USART_MODULE_ID index ,
5536  int8_t data ,
5537  bool Bit9th ) ;
5538 //******************************************************************************
5539 /* Function:
5540  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5541  Summary:
5542  Transmits the break character.
5543  Description:
5544  This function transmits the break character.
5545  This operation is atomic.
5546  Precondition:
5547  The application should wait for the transmitter to be idle, before calling
5548  this function.
5549  Parameters:
5550  index - Identifier for the device instance to be configured
5551  Returns:
5552  None.
5553  Example:
5554  <code>
5555 #define MY_USART_INSTANCE USART_ID_1
5556  // Wait for the Transmit buffer to be empty.
5557  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5558  // Transmit the break character.
5559  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5560  // wait for the break transmission to complete
5561  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5562  </code>
5563  Remarks:
5564  After the break has been transmitted, the application can start
5565  transmitting next bytes.
5566 
5567  This feature may not be available on all devices. Please refer to the
5568  specific device data sheet to determine availability or use
5569  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5570  this feature is available.
5571 */
5572 
5573 void
5575  USART_MODULE_ID index ) ;
5576 //******************************************************************************
5577 /* Function:
5578  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
5579  Summary:
5580  Returns the status of the break transmission
5581  Description:
5582  The function returns the status of the break transmission.
5583  This operation is atomic.
5584  Precondition:
5585  None.
5586  Parameters:
5587  index - Identifier for the device instance to be configured
5588  Returns:
5589  - true - Transmit break on the next transmission
5590  - false - Break transmission completed or not started
5591  Example:
5592  <code>
5593 #define MY_USART_INSTANCE USART_ID_1
5594  // Wait for the Transmit buffer to be empty.
5595  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5596  // Transmit the break character.
5597  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5598  // wait for the break transmission to complete
5599  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5600  </code>
5601  Remarks:
5602  After the break has been transmitted, the application can start
5603  transmitting next bytes.
5604 
5605  This feature may not be available on all devices. Please refer to the
5606  specific device data sheet to determine availability or use
5607  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5608  this feature is available.
5609 */
5610 
5611 bool
5613  USART_MODULE_ID index ) ;
5614 //******************************************************************************
5615 /* Function:
5616  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
5617  Summary:
5618  Identifies if the receive data is available for the specified USART module.
5619  Description:
5620  This function identifies if the receive data is available for the specified
5621  USART module.
5622  This operation is atomic.
5623  Precondition:
5624  None.
5625  Parameters:
5626  index - Identifier for the device instance to be configured
5627  Returns:
5628  - true - The data is available
5629  - false - The data is not available
5630  Example:
5631  <code>
5632 #define MY_USART_INSTANCE USART_ID_1
5633  int8_t mydata;
5634  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5635  {
5636  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5637  }
5638  </code>
5639  Remarks:
5640  This feature may not be available on all devices. Please refer to the
5641  specific device data sheet to determine availability or use
5642  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
5643  whether this feature is available.
5644 */
5645 
5646 bool
5648  USART_MODULE_ID index ) ;
5649 //******************************************************************************
5650 /* Function:
5651  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
5652  Summary:
5653  Clears a USART vverrun error.
5654  Description:
5655  This function clears an overrun error. Clearing the error, resets the receive buffer.
5656  This operation is atomic.
5657  Precondition:
5658  None.
5659  Parameters:
5660  index - Identifier for the device instance to be configured
5661  Returns:
5662  None.
5663  Example:
5664  <code>
5665 #define MY_USART_INSTANCE USART_ID_1
5666  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5667  {
5668  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5669  }
5670  </code>
5671  Remarks:
5672  WARNING: Calling this API will clear all of the previously received data.
5673 
5674  This feature may not be available on all devices. Please refer to the
5675  specific device data sheet to determine availability or use
5676  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5677  whether this feature is available.
5678 */
5679 
5680 void
5682  USART_MODULE_ID index ) ;
5683 //******************************************************************************
5684 /* Function:
5685  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
5686  Summary:
5687  Gets the transmit buffer full status.
5688  Description:
5689  This function gets the transmit status of the specified USART module.
5690  This operation is atomic.
5691  Precondition:
5692  None.
5693  Parameters:
5694  index - Identifier for the device instance to be configured
5695  Returns:
5696  - true - The transmit buffer is full
5697  - false - The transmit buffer is not full, at least one more
5698  character can be written
5699  Example:
5700  <code>
5701 #define MY_USART_INSTANCE USART_ID_1
5702  // Wait for the Transmit buffer to be empty.
5703  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5704  // Transmit the break character.
5705  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5706  </code>
5707  Remarks:
5708  This feature may not be available on all devices. Please refer to the
5709  specific device data sheet to determine availability or use
5710  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
5711  whether this feature is available.
5712 */
5713 
5714 bool
5716  USART_MODULE_ID index ) ;
5717 //******************************************************************************
5718 /* Function:
5719  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
5720  Summary:
5721  Gets the transmit shift register empty status.
5722  Description:
5723  This function gets the transmit shift register empty status.
5724  This operation is atomic.
5725  Precondition:
5726  None.
5727  Parameters:
5728  index - Identifier for the device instance to be configured
5729  Returns:
5730  - true - The transmit shift register is empty
5731  - false - The transmit shift register is not empty
5732  Example:
5733  <code>
5734 #define MY_USART_INSTANCE USART_ID_1
5735  // Wait for the Transmit buffer to be empty.
5736  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
5737  // Transmit the break character.
5738  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5739  </code>
5740  Remarks:
5741  This feature may not be available on all devices. Please refer to the
5742  specific device data sheet to determine availability or use
5743  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
5744  whether this feature is available.
5745 */
5746 
5747 bool
5749  USART_MODULE_ID index ) ;
5750 //******************************************************************************
5751 /* Function:
5752  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
5753  Summary:
5754  Gets the framing error status.
5755  Description:
5756  This function gets the framing error status.
5757  This operation is atomic.
5758  Precondition:
5759  None.
5760  Parameters:
5761  index - Identifier for the device instance to be configured
5762  Returns:
5763  - true - The framing error was detected on the current character
5764  - false - The framing error was not detected on the current
5765  character
5766  Example:
5767  <code>
5768 #define MY_USART_INSTANCE USART_ID_1
5769  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
5770  </code>
5771  Remarks:
5772  Reading the error clears the error.
5773  This feature may not be available on all devices. Please refer to the
5774  specific device data sheet to determine availability or use
5775  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
5776  whether this feature is available.
5777 */
5778 
5779 bool
5781  USART_MODULE_ID index ) ;
5782 //******************************************************************************
5783 /* Function:
5784  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
5785  Summary:
5786  Gets the parity error status.
5787  Description:
5788  This function gets the parity error status.
5789  This operation is atomic.
5790  Precondition:
5791  None.
5792  Parameters:
5793  index - Identifier for the device instance to be configured
5794  Returns:
5795  - true - The parity error was detected on the current character
5796  - false - The parity error was not detected on the current character
5797  Example:
5798  <code>
5799 #define MY_USART_INSTANCE USART_ID_1
5800  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
5801  </code>
5802  Remarks:
5803  Reading the error clears the error.
5804  A Parity error is irrelevant in case of 9-bit mode.
5805  This feature may not be available on all devices. Please refer to the
5806  specific device data sheet to determine availability or use
5807  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
5808  whether this feature is available.
5809 */
5810 
5811 bool
5813  USART_MODULE_ID index ) ;
5814 //******************************************************************************
5815 /* Function:
5816  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
5817  Summary:
5818  Identifies if there was a receiver overrun error.
5819  Description:
5820  This function identifies if there was a receiver overrun error.
5821  This operation is atomic.
5822  Precondition:
5823  None.
5824  Parameters:
5825  index - Identifier for the device instance to be configured
5826  Returns:
5827  - true - The receive buffer has overflowed
5828  - false - The receive buffer has not overflowed
5829  Example:
5830  <code>
5831 #define MY_USART_INSTANCE USART_ID_1
5832  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5833  {
5834  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5835  }
5836  </code>
5837  Remarks:
5838  This feature may not be available on all devices. Please refer to the
5839  specific device data sheet to determine availability or use
5840  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5841  whether this feature is available.
5842 */
5843 
5844 bool
5846  USART_MODULE_ID index ) ;
5847 //******************************************************************************
5848 /* Function:
5849  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
5850  Summary:
5851  Identifies if the receiver is idle.
5852  Description:
5853  This function identifies if the receiver is idle.
5854  This operation is atomic.
5855  Precondition:
5856  None.
5857  Parameters:
5858  index - Identifier for the device instance to be configured
5859  Returns:
5860  - true - The receive buffer is idle
5861  - false - The receive buffer is not idle
5862  Example:
5863  <code>
5864 #define MY_USART_INSTANCE USART_ID_1
5865  int8_t mydata;
5866  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
5867  {
5868  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5869  }
5870  </code>
5871  Remarks:
5872  This feature may not be available on all devices. Please refer to the
5873  specific device data sheet to determine availability or use
5874  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
5875  whether this feature is available.
5876 */
5877 
5878 bool
5880  USART_MODULE_ID index ) ;
5881 //******************************************************************************
5882 /* Function:
5883  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
5884  Summary:
5885  Enables the USART receiver.
5886  Description:
5887  This function enables the USART receiver.
5888  This operation is atomic.
5889  Precondition:
5890  None.
5891  Parameters:
5892  index - Identifier for the device instance to be configured
5893  Returns:
5894  None.
5895  Example:
5896  <code>
5897 #define MY_USART_INSTANCE USART_ID_1
5898  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
5899  </code>
5900  Remarks:
5901  This feature may not be available on all devices. Please refer to the
5902  specific device data sheet to determine availability or use
5903  PLIB_USART_ExistsReceiverEnable in your application to determine
5904  whether this feature is available.
5905 */
5906 
5907 void
5909  USART_MODULE_ID index ) ;
5910 //******************************************************************************
5911 /* Function:
5912  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
5913  Summary:
5914  Disables the USART receiver.
5915  Description:
5916  This function disables the USART receiver.
5917  This operation is atomic.
5918  Precondition:
5919  None.
5920  Parameters:
5921  index - Identifier for the device instance to be configured
5922  Returns:
5923  None.
5924  Example:
5925  <code>
5926 #define MY_USART_INSTANCE USART_ID_1
5927  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
5928  </code>
5929  Remarks:
5930  This feature may not be available on all devices. Please refer to the
5931  specific device data sheet to determine availability or use
5932  PLIB_USART_ExistsReceiverEnable in your application to determine
5933  whether this feature is available.
5934 */
5935 
5936 void
5938  USART_MODULE_ID index ) ;
5939 //******************************************************************************
5940 /* Function:
5941  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
5942  Summary:
5943  Enables the Transmit Idle Low state.
5944  Description:
5945  This function enables the Transmit Idle Low state. In the USART Synchronous
5946  mode, this function configures that the TX polarity, the idle state is low.
5947  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
5948  state to a '1'.
5949  This operation is atomic.
5950  Precondition:
5951  None.
5952  Parameters:
5953  index - Identifier for the device instance to be configured
5954  Returns:
5955  None.
5956  Example:
5957  <code>
5958 #define MY_USART_INSTANCE USART_ID_1
5959  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
5960  </code>
5961  Remarks:
5962  This feature may not be available on all devices. Please refer to the
5963  specific device data sheet to determine availability or use
5964  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5965  whether this feature is available.
5966 */
5967 
5968 void
5970  USART_MODULE_ID index ) ;
5971 //******************************************************************************
5972 /* Function:
5973  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
5974  Summary:
5975  Disables the Transmit Idle Low state.
5976  Description:
5977  This function disables the Transmit Idle Low state. In USART Synchronous mode,
5978  this function configures that the TX polarity the idle state is high.
5979  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
5980  state to a '0'.
5981  This operation is atomic.
5982  Precondition:
5983  None.
5984  Parameters:
5985  index - Identifier for the device instance to be configured
5986  Returns:
5987  None.
5988  Example:
5989  <code>
5990 #define MY_USART_INSTANCE USART_ID_1
5991  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
5992  </code>
5993  Remarks:
5994  This feature may not be available on all devices. Please refer to the
5995  specific device data sheet to determine availability or use
5996  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5997  whether this feature is available.
5998 */
5999 
6000 void
6002  USART_MODULE_ID index ) ;
6003 //******************************************************************************
6004 /* Function:
6005  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6006  Summary:
6007  Enables receive polarity inversion.
6008  Description:
6009  This function enables receive polarity inversion. In the USART Synchronous mode,
6010  this function configures that the data is inverted.
6011  This operation is atomic.
6012  Precondition:
6013  None.
6014  Parameters:
6015  index - Identifier for the device instance to be configured
6016  Returns:
6017  None.
6018  Example:
6019  <code>
6020 #define MY_USART_INSTANCE USART_ID_1
6021  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6022  </code>
6023  Remarks:
6024  This feature may not be available on all devices. Please refer to the
6025  specific device data sheet to determine availability or use
6026  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6027  whether this feature is available.
6028 */
6029 
6030 void
6032  USART_MODULE_ID index ) ;
6033 //******************************************************************************
6034 /* Function:
6035  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6036  Summary:
6037  Disables receive polarity inversion.
6038  This operation is atomic.
6039  Description:
6040  This function disables receive polarity inversion. In the USART Synchronous
6041  mode, this function configures that the data is not inverted.
6042  Precondition:
6043  None.
6044  Parameters:
6045  index - Identifier for the device instance to be configured
6046  Returns:
6047  None.
6048  Example:
6049  <code>
6050 #define MY_USART_INSTANCE USART_ID_1
6051  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6052  </code>
6053  Remarks:
6054  This feature may not be available on all devices. Please refer to the
6055  specific device data sheet to determine availability or use
6056  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6057  whether this feature is available.
6058 */
6059 
6060 void
6062  USART_MODULE_ID index ) ;
6063 //******************************************************************************
6064 /* Function:
6065  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6066  Summary:
6067  Enables high baud rate selection.
6068  Description:
6069  This function enables high baud rate selection.
6070  This operation is atomic.
6071  Precondition:
6072  None.
6073  Parameters:
6074  index - Identifier for the device instance to be configured
6075  Returns:
6076  None.
6077  Example:
6078  <code>
6079 #define MY_USART_INSTANCE USART_ID_1
6080  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6081  </code>
6082  Remarks:
6083  This feature may not be available on all devices. Please refer to the
6084  specific device data sheet to determine availability or use
6085  PLIB_USART_ExistsBaudRateHigh in your application to determine
6086  whether this feature is available.
6087 */
6088 
6089 void
6091  USART_MODULE_ID index ) ;
6092 //******************************************************************************
6093 /* Function:
6094  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6095  Summary:
6096  Disables the high baud rate selection.
6097  Description:
6098  This function disables the high baud rate selection.
6099  This operation is atomic.
6100  Precondition:
6101  None.
6102  Parameters:
6103  index - Identifier for the device instance to be configured
6104  Returns:
6105  None.
6106  Example:
6107  <code>
6108 #define MY_USART_INSTANCE USART_ID_1
6109  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6110  </code>
6111  Remarks:
6112  This feature may not be available on all devices. Please refer to the
6113  specific device data sheet to determine availability or use
6114  PLIB_USART_ExistsBaudRateHigh in your application to determine
6115  whether this feature is available.
6116 */
6117 
6118 void
6120  USART_MODULE_ID index ) ;
6121 //******************************************************************************
6122 /* Function:
6123  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6124  USART_TRANSMIT_INTR_MODE interruptMode )
6125  Summary:
6126  Sets the USART transmitter interrupt mode.
6127  Description:
6128  This function sets the condition in which the USART module should generate
6129  an interrupt.
6130  This operation is atomic.
6131  Precondition:
6132  None.
6133  Parameters:
6134  index - Identifier for the device instance to be configured
6135  interruptMode - Interrupt mode; for possible configurations, refer to
6136  USART_TRANSMIT_INTR_MODE
6137  Returns:
6138  None.
6139  Example:
6140  <code>
6141 #define MY_USART_INSTANCE USART_ID_1
6142  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6143  USART_TRANSMIT_FIFO_EMPTY );
6144  </code>
6145  Remarks:
6146  This feature may not be available on all devices. Please refer to the
6147  specific device data sheet to determine availability or use
6148  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6149  whether this feature is available.
6150 */
6151 
6152 void
6154  USART_MODULE_ID index ,
6155  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6156 //******************************************************************************
6157 /* Function:
6158  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6159  USART_RECEIVE_INTR_MODE interruptMode )
6160  Summary:
6161  Sets the USART receiver FIFO level.
6162  Description:
6163  This function sets the USART receiver FIFO level.
6164  This operation is atomic.
6165  Precondition:
6166  None.
6167  Parameters:
6168  index - Identifier for the device instance to be configured
6169  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6170  Returns:
6171  None.
6172  Example:
6173  <code>
6174 #define MY_USART_INSTANCE USART_ID_1
6175  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6176  USART_RECEIVE_FIFO_ONE_CHAR );
6177  </code>
6178  Remarks:
6179  This feature may not be available on all devices. Please refer to the
6180  specific device data sheet to determine availability or use
6181  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6182  whether this feature is available.
6183 */
6184 
6185 void
6187  USART_MODULE_ID index ,
6188  USART_RECEIVE_INTR_MODE interruptMode ) ;
6189 //******************************************************************************
6190 /* Function:
6191  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6192  USART_LINECONTROL_MODE dataFlowConfig)
6193  Summary:
6194  Sets the data flow configuration.
6195  Description:
6196  This function sets the USART data flow configuration based on the mask
6197  provided and the specified baud rate.
6198  Precondition:
6199  None.
6200  Parameters:
6201  index - Identifier for the device instance to be configured
6202  mode - For possible data flow configurations, refer to
6203  USART_LINECONTROL_MODE
6204  Returns:
6205  None.
6206  Example:
6207  <code>
6208 #define MY_USART_INSTANCE USART_ID_1
6209  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6210  USART_8N1);
6211  </code>
6212  Remarks:
6213  This feature may not be available on all devices. Please refer to the
6214  specific device data sheet to determine availability or use
6215  PLIB_USART_ExistsLineControlMode in your application to determine
6216  whether this feature is available.
6217 */
6218 
6219 void
6221  USART_MODULE_ID index ,
6222  USART_LINECONTROL_MODE dataFlowConfig ) ;
6223 //******************************************************************************
6224 /* Function:
6225  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6226  USART_HANDSHAKE_MODE handshakeConfig)
6227  Summary:
6228  Sets the data flow configuration.
6229  Description:
6230  This function sets the USART data flow configuration based on the mask
6231  provided and the specified baud rate.
6232  Precondition:
6233  None.
6234  Parameters:
6235  index - Identifier for the device instance to be configured
6236  mode - For possible data flow configurations, refer to
6237  USART_HANDSHAKE_MODE
6238  Returns:
6239  None.
6240  Example:
6241  <code>
6242 #define MY_USART_INSTANCE USART_ID_1
6243  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6244  USART_HANDSHAKE_MODE_SIMPLEX);
6245  </code>
6246  Remarks:
6247  This feature may not be available on all devices. Please refer to the
6248  specific device data sheet to determine availability or use
6249  PLIB_USART_ExistsHandshakeMode in your application to determine
6250  whether this feature is available.
6251 */
6252 
6253 void
6255  USART_MODULE_ID index ,
6256  USART_HANDSHAKE_MODE handshakeConfig ) ;
6257 //******************************************************************************
6258 /* Function:
6259  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6260  int8_t Mask)
6261  Summary:
6262  Setup the automatic Address Detect mode.
6263  Description:
6264  This function configures the automatic Address Detect mode. Uses the mask as
6265  the address character for automatic address detection.
6266  This operation is atomic.
6267  Precondition:
6268  None.
6269  Parameters:
6270  index - Identifier for the device instance to be configured
6271  Mask - Address character to be used, when enabled
6272  Returns:
6273  None.
6274  Example:
6275  <code>
6276 #define MY_USART_INSTANCE USART_ID_1
6277  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6278  MY_DEVICE_ADDRESS);
6279  </code>
6280  Remarks:
6281  This feature may not be available on all devices. Please refer to the
6282  specific device data sheet to determine availability or use
6283  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6284  whether this feature is available.
6285 */
6286 
6287 void
6289  USART_MODULE_ID index ,
6290  int8_t Mask ) ;
6291 //******************************************************************************
6292 /* Function:
6293  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6294  USART_MODULE_ID index )
6295  Summary:
6296  Disables the automatic Address Detect mode.
6297  Description:
6298  This function disables the automatic Address Detect mode.
6299  This operation is atomic.
6300  Precondition:
6301  None.
6302  Parameters:
6303  index - Identifier for the device instance to be configured
6304  Returns:
6305  None.
6306  Example:
6307  <code>
6308 #define MY_USART_INSTANCE USART_ID_1
6309  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6310  </code>
6311  Remarks:
6312  This feature may not be available on all devices. Please refer to the
6313  specific device data sheet to determine availability or use
6314  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6315  whether this feature is available.
6316 */
6317 
6318 void
6320  USART_MODULE_ID index ) ;
6321 //******************************************************************************
6322 /* Function:
6323  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6324  Summary:
6325  Enables the IrDA encoder and decoder.
6326  Description:
6327  This function enables the IrDA encoder and decoder.
6328  This operation is atomic.
6329  Precondition:
6330  None.
6331  Parameters:
6332  index - Identifier for the device instance to be configured
6333  Returns:
6334  None.
6335  Example:
6336  <code>
6337 #define MY_USART_INSTANCE USART_ID_1
6338  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6339  </code>
6340  Remarks:
6341  This feature may not be available on all devices. Please refer to the
6342  specific device data sheet to determine availability or use
6343  PLIB_USART_ExistsIrDA in your application to determine
6344  whether this feature is available.
6345 */
6346 
6347 void
6349  USART_MODULE_ID index ) ;
6350 //******************************************************************************
6351 /* Function:
6352  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6353  Summary:
6354  Disables the IrDA encoder and decoder.
6355  Description:
6356  This function disables the IrDA encoder and decoder.
6357  This operation is atomic.
6358  Precondition:
6359  None.
6360  Parameters:
6361  index - Identifier for the device instance to be configured
6362  Returns:
6363  None.
6364  Example:
6365  <code>
6366 #define MY_USART_INSTANCE USART_ID_1
6367  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6368  </code>
6369  Remarks:
6370  By default, the IrDA Encoder and Decoder are disabled.
6371 
6372  This feature may not be available on all devices. Please refer to the
6373  specific device data sheet to determine availability or use
6374  PLIB_USART_ExistsIrDA in your application to determine
6375  whether this feature is available.
6376 */
6377 
6378 void
6380  USART_MODULE_ID index ) ;
6381 //******************************************************************************
6382 /* Function:
6383  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6384  Summary:
6385  Enables Loopback mode.
6386  Description:
6387  This function enables Loopback mode.
6388  This operation is atomic.
6389  Precondition:
6390  None.
6391  Parameters:
6392  index - Identifier for the device instance to be configured
6393  Returns:
6394  None.
6395  Example:
6396  <code>
6397 #define MY_USART_INSTANCE USART_ID_1
6398  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6399  </code>
6400  Remarks:
6401  By default, Loopback mode is disabled.
6402 
6403  This feature may not be available on all devices. Please refer to the
6404  specific device data sheet to determine availability or use
6405  PLIB_USART_ExistsLoopback in your application to determine
6406  whether this feature is available.
6407 */
6408 
6409 void
6411  USART_MODULE_ID index ) ;
6412 //******************************************************************************
6413 /* Function:
6414  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6415  Summary:
6416  Disables Loopback mode.
6417  Description:
6418  This function disables Loopback mode.
6419  This operation is atomic.
6420  Precondition:
6421  None.
6422  Parameters:
6423  index - Identifier for the device instance to be configured
6424  Returns:
6425  None.
6426  Example:
6427  <code>
6428 #define MY_USART_INSTANCE USART_ID_1
6429  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6430  </code>
6431  Remarks:
6432  By default, Loopback mode is disabled.
6433  This feature may not be available on all devices. Please refer to the
6434  specific device data sheet to determine availability or use
6435  PLIB_USART_ExistsLoopback in your application to determine
6436  whether this feature is available.
6437 */
6438 
6439 void
6441  USART_MODULE_ID index ) ;
6442 //******************************************************************************
6443 /* Function:
6444  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6445  USART_OPERATION_MODE operationmode)
6446  Summary:
6447  Configures the operation mode of the USART module.
6448  Description:
6449  This function configures the operation mode of the USART (i.e., controls the
6450  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6451  possible settings.
6452  Precondition:
6453  None.
6454  Parameters:
6455  index - Identifier for the device instance to be configured
6456  operationmode - One of the possible values from USART_OPERATION_MODE
6457  Returns:
6458  None.
6459  Example:
6460  <code>
6461 #define MY_USART_INSTANCE USART_ID_1
6462  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6463  </code>
6464  Remarks:
6465  This feature may not be available on all devices. Please refer to the
6466  specific device data sheet to determine availability or use
6467  PLIB_USART_ExistsOperationMode in your application to determine
6468  whether this feature is available.
6469 */
6470 
6471 void
6473  USART_MODULE_ID index ,
6474  USART_OPERATION_MODE operationmode ) ;
6475 //******************************************************************************
6476 /* Function:
6477  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6478  Summary:
6479  Discontinues operation when the device enters Idle mode.
6480  Description:
6481  This function enables the USART module to discontinue operation when the
6482  device enters Idle mode.
6483  This operation is atomic.
6484  Precondition:
6485  None.
6486  Parameters:
6487  index - Identifier for the device instance to be configured
6488  Returns:
6489  None.
6490  Example:
6491  <code>
6492 #define MY_USART_INSTANCE USART_ID_1
6493  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6494  </code>
6495  Remarks:
6496  This feature may not be available on all devices. Please refer to the
6497  specific device data sheet to determine availability or use
6498  PLIB_USART_ExistsStopInIdle in your application to determine
6499  whether this feature is available.
6500 */
6501 
6502 void
6504  USART_MODULE_ID index ) ;
6505 //******************************************************************************
6506 /* Function:
6507  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6508  Summary:
6509  Disables the Stop in Idle mode (the USART module continues operation when
6510  the device is in Idle mode).
6511  Description:
6512  This function disables the Stop in Idle mode. The USART module continues
6513  operation when the device is in Idle mode.
6514  This operation is atomic.
6515  Precondition:
6516  None.
6517  Parameters:
6518  index - Identifier for the device instance to be configured
6519  Returns:
6520  None.
6521  Example:
6522  <code>
6523 #define MY_USART_INSTANCE USART_ID_1
6524  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6525  </code>
6526  Remarks:
6527  By default, the USART module will continue operation in Idle mode.
6528 
6529  This feature may not be available on all devices. Please refer to the
6530  specific device data sheet to determine availability or use
6531  PLIB_USART_ExistsStopInIdle in your application to determine
6532  whether this feature is available.
6533 */
6534 
6535 void
6537  USART_MODULE_ID index ) ;
6538 //******************************************************************************
6539 /* Function:
6540  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6541  Summary:
6542  Enables the wake-up on start bit detection feature during Sleep mode.
6543  Description:
6544  This function enables the wake-up on start feature during Sleep mode.
6545  This operation is atomic.
6546  Precondition:
6547  None.
6548  Parameters:
6549  index - Identifier for the device instance to be configured
6550  Returns:
6551  None.
6552  Example:
6553  <code>
6554 #define MY_USART_INSTANCE USART_ID_1
6555  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6556  </code>
6557  Remarks:
6558  This feature may not be available on all devices. Please refer to the
6559  specific device data sheet to determine availability or use
6560  PLIB_USART_ExistsWakeOnStart in your application to determine
6561  whether this feature is available.
6562 */
6563 
6564 void
6566  USART_MODULE_ID index ) ;
6567 //******************************************************************************
6568 /* Function:
6569  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
6570  Summary:
6571  Disables the wake-up on start bit detection feature during Sleep mode.
6572  Description:
6573  This function disables the wake-up on start bit detection feature during
6574  Sleep mode.
6575  This operation is atomic.
6576  Precondition:
6577  None.
6578  Parameters:
6579  index - Identifier for the device instance to be configured
6580  Returns:
6581  None.
6582  Example:
6583  <code>
6584 #define MY_USART_INSTANCE USART_ID_1
6585  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
6586  </code>
6587  Remarks:
6588  This feature may not be available on all devices. Please refer to the
6589  specific device data sheet to determine availability or use
6590  PLIB_USART_ExistsWakeOnStart in your application to determine
6591  whether this feature is available.
6592 */
6593 
6594 void
6596  USART_MODULE_ID index ) ;
6597 //******************************************************************************
6598 /* Function:
6599  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
6600  Summary:
6601  Gets the state of the sync break event completion.
6602  Description:
6603  This function returns the status of the sync break event, when called
6604  after enabling using PLIB_USART_WakeOnStartEnable.
6605  This operation is atomic.
6606  Precondition:
6607  None.
6608  Parameters:
6609  index - Identifier for the device instance to be configured
6610  Returns:
6611  None.
6612  Example:
6613  <code>
6614 #define MY_USART_INSTANCE USART_ID_1
6615  //Call the interface just prior to entering the sleep mode.
6616  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6617  // Check the status if the Sync break event is over.
6618  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
6619  {
6620  // Do Something
6621  }
6622  </code>
6623  Remarks:
6624  This feature may not be available on all devices. Please refer to the
6625  specific device data sheet to determine availability or use
6626  PLIB_USART_ExistsWakeOnStart in your application to determine
6627  whether this feature is available.
6628 */
6629 
6630 bool
6632  USART_MODULE_ID index ) ;
6633 //******************************************************************************
6634 /* Function:
6635  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
6636  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
6637  Summary:
6638  Enables or disables general features of the USART module.
6639  Description:
6640  This function enables or disables general features of the USART module.
6641  Precondition:
6642  None.
6643  Parameters:
6644  index - Identifier for the device instance to be configured
6645  autobaud - If true, auto baud rate detection is enabled. If false
6646  the feature is disabled.
6647  loopBackMode - If true, loop back is enabled. If false the feature is
6648  disabled.
6649  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
6650  mode on USART activity. If false the feature is disabled.
6651  irdaMode - If true, the IrDA mode is enabled. If false the feature
6652  is disabled.
6653  stopInIdle - If true, module will stop functioning when CPU enters Idle
6654  mode. If false, the feature is disabled.
6655  Returns:
6656  None.
6657  Example:
6658  <code>
6659 #define MY_USART_INSTANCE USART_ID_1
6660  // Enable loopback, disable IrDA, disable auto baud detection and disable
6661  // wake from sleep. Enable stop in idle
6662  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
6663  false, false, true);
6664  </code>
6665  Remarks:
6666  Enabling the wake from sleep feature will cause the first character that is
6667  received by the USART module to be discarded. This feature should only be
6668  enabled if the CPU is to placed in power saving mode.
6669 
6670  This feature may not be available on all devices. Please refer to the
6671  specific device data sheet to determine availability. Availability of this
6672  function can also be determined if all of the following functions return
6673  true:
6674  - PLIB_USART_ExistsLoopback
6675  - PLIB_USART_ExistsBaudRateAutoDetect
6676  - PLIB_USART_ExistsWakeOnStart
6677  - PLIB_USART_ExistsIrDA
6678  - PLIB_USART_ExistsStopInIdle
6679 */
6680 
6681 void
6683  USART_MODULE_ID index ,
6684  bool autobaud ,
6685  bool loopBackMode ,
6686  bool wakeFromSleep ,
6687  bool irdaMode ,
6688  bool stopInIdle ) ;
6689 //******************************************************************************
6690 /* Function:
6691  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
6692  USART_RECEIVE_INTR_MODE receiveInterruptMode,
6693  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
6694  USART_OPERATION_MODE operationMode);
6695  Summary:
6696  Configures the Receive and Transmit FIFO interrupt levels and the hardware
6697  lines to be used by the module.
6698  Description:
6699  This function configures the Receive and Transmit FIFO interrupt levels and
6700  the hardware lines to be used by the module.
6701  Precondition:
6702  None.
6703  Parameters:
6704  index - Identifier for the device instance to be configured
6705  receiveInterruptMode - Receiver FIFO interrupt level
6706  transmitInterruptMode - Transmit FIFO interrupt level
6707  operationMode - Hardware lines to be used by the USART.
6708  Returns:
6709  None.
6710  Example:
6711  <code>
6712 #define MY_USART_INSTANCE USART_ID_1
6713  // Set receive FIFO to interrupt when FIFO is 3/4 level full
6714  // Set Transmit FIFO to interrupt when FIFO is empty
6715  // USART module will only use RX and TX hardware lines
6716  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
6717  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
6718  </code>
6719  Remarks:
6720  This feature may not be available on all devices. Please refer to the
6721  specific device data sheet to determine availability. Availability of this
6722  function can also be determined if all of the following functions return
6723  true:
6724  - PLIB_USART_ExistsReceiverInterruptMode
6725  - PLIB_USART_ExistsTransmitterInterruptMode
6726  - PLIB_USART_ExistsOperationMode
6727 */
6728 
6729 void
6731  USART_MODULE_ID index ,
6732  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
6733  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
6734  USART_OPERATION_MODE operationMode ) ;
6735 //******************************************************************************
6736 /* Function:
6737  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
6738  clockFrequency, uint32_t baudRate );
6739  Summary:
6740  Sets the baud rate to the desired value and enables the USART receiver,
6741  transmitter and the USART module.
6742  Description:
6743  This function sets the baud rate to the desired value and enables the USART
6744  receiver, USART transmitter and USART module.
6745  Precondition:
6746  None.
6747  Parameters:
6748  index - Identifier for the device instance to be configured
6749  baudRate - Baud Rate Value
6750  clockFrequency - Clock Frequency
6751  Returns:
6752  None.
6753  Example:
6754  <code>
6755 #define MY_USART_INSTANCE USART_ID_1
6756  uint32_t baudRateValue ;
6757  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
6758  </code>
6759  Remarks:
6760  Setting a new baud rate value causes the baud rate timer to reset.
6761  This ensures that the baud rate timer does not have to overflow before
6762  outputting the new baud rate.
6763 
6764  If the system clock is changed during an active receive operation, a
6765  receiver error or data loss may result. To avoid this issue verify that
6766  no receptions are in progress before changing the system clock.
6767 
6768  This feature may not be available on all devices. Please refer to the
6769  specific device data sheet to determine availability. Availability of this
6770  function can also be determined if all of the following functions return
6771  true:
6772  - PLIB_USART_ExistsBaudRate
6773  - PLIB_USART_ExistsTransmitterEnable
6774  - PLIB_USART_ExistsReceiverEnable
6775  - PLIB_USART_ExistsEnable
6776 */
6777 
6778 void
6780  USART_MODULE_ID index ,
6781  uint32_t systemClock ,
6782  uint32_t baud ) ;
6783 //******************************************************************************
6784 /* Function:
6785  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
6786  Summary:
6787  Return the status of all errors in the specified USART module.
6788  Description:
6789  This function returns status of all errors in the specified USART module.
6790  The return value can be bitwise AND'ed with a USART_ERROR type to know the
6791  status of a specific error.
6792  This operation is atomic.
6793  Precondition:
6794  None.
6795  Parameters:
6796  index - Identifier for the device instance to be configured
6797  Returns:
6798  Returns a bitmap of USART error status.
6799  Example:
6800  <code>
6801 #define MY_USART_INSTANCE USART_ID_1
6802  USART_ERROR error;
6803  // Get the status of all errors.
6804  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
6805  // Check if parity error is active
6806  if(error & USART_ERROR_PARITY)
6807  {
6808  // Parity error is active.
6809  }
6810  else if(error & USART_ERROR_FRAMING)
6811  {
6812  // Framing error is active.
6813  }
6814  </code>
6815  Remarks:
6816  This feature may not be available on all devices. Please refer to the
6817  specific device data sheet to determine availability. Availability of this
6818  function can also be determined if all of the followings functions return
6819  true:
6820  - PLIB_USART_ExistsReceiverFramingErrorStatus
6821  - PLIB_USART_ExistsReceiverParityErrorStatus
6822  - PLIB_USART_ExistsReceiverOverrunStatus
6823 */
6824 
6825 USART_ERROR
6827  USART_MODULE_ID index ) ;
6828 //******************************************************************************
6829 /* Function:
6830  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
6831  Summary:
6832  Returns the address of the USART TX register
6833  Description:
6834  This function returns the address of the USART TX register.
6835  This operation is atomic.
6836  Preconditions:
6837  None.
6838  Parameters:
6839  index - Identifier for the device instance
6840  Returns:
6841  Address of the USART TX register
6842  Remarks:
6843  None.
6844 */
6845 
6846 void *
6848  USART_MODULE_ID index ) ;
6849 //******************************************************************************
6850 /* Function:
6851  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
6852  Summary:
6853  Returns the address of the USART RX register
6854  Description:
6855  This function returns the address of the USART RX register.
6856  This operation is atomic.
6857  Preconditions:
6858  None.
6859  Parameters:
6860  index - Identifier for the device instance
6861  Returns:
6862  Address of the USART RX register
6863  Remarks:
6864  None.
6865 */
6866 
6867 void *
6869  USART_MODULE_ID index ) ;
6870 // *****************************************************************************
6871 // *****************************************************************************
6872 // Section: USART Peripheral Library Exists Functions
6873 // *****************************************************************************
6874 // *****************************************************************************
6875 /* The following functions indicate the existence of the features on the device.
6876 */
6877 //******************************************************************************
6878 /* Function:
6879  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
6880  Summary:
6881  Identifies whether the Run in overflow condition feature exists on the USART module.
6882  Description:
6883  This function identifies whether the Run in Overflow condition feature is
6884  available on the USART module. When this function returns true, these
6885  functions are supported on the device:
6886  - PLIB_USART_RunInOverflowEnable
6887  - PLIB_USART_RunInOverflowDisable
6888  - PLIB_USART_RunInOverflowIsEnabled
6889  This operation is atomic.
6890  Preconditions:
6891  None.
6892  Parameters:
6893  index - Identifier for the device instance
6894  Returns:
6895  - true - The Run in Overflow condition feature is supported on the device
6896  - false - The Run in Overflow condition feature is not supported on the device
6897  Remarks:
6898  None.
6899 */
6900 
6901 bool
6903  USART_MODULE_ID index ) ;
6904 //******************************************************************************
6905 /* Function:
6906  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
6907  Summary:
6908  Identifies whether the BRG Clock source select feature exists on the
6909  USART module.
6910  Description:
6911  This function identifies whether the BRG Clock source select feature is
6912  available on the USART module. When this function returns true, these
6913  functions are supported on the device:
6914  - PLIB_USART_BRGClockSourceSelect
6915  - PLIB_USART_BRGClockSourceGet
6916  This operation is atomic.
6917  Preconditions:
6918  None.
6919  Parameters:
6920  index - Identifier for the device instance
6921  Returns:
6922  - true - The BRG clock source select feature is supported on the device
6923  - false - The BRG clock source select feature is not supported on the device
6924  Remarks:
6925  None.
6926 */
6927 
6928 bool
6930  USART_MODULE_ID index ) ;
6931 //******************************************************************************
6932 /* Function:
6933  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
6934  Summary:
6935  Identifies whether the module running status feature exists on the
6936  USART module.
6937  Description:
6938  This function identifies whether the module running status feature is
6939  available on the USART module. When this function returns true, this
6940  function is supported on the device:
6941  - PLIB_USART_ModuleIsBusy
6942  This operation is atomic.
6943  Preconditions:
6944  None.
6945  Parameters:
6946  index - Identifier for the device instance
6947  Returns:
6948  - true - The Module running status feature is supported on the device
6949  - false - The Module running status feature is not supported on the device
6950  Remarks:
6951  None.
6952 */
6953 
6954 bool
6956  USART_MODULE_ID index ) ;
6957 //******************************************************************************
6958 /* Function:
6959  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
6960  Summary:
6961  Identifies whether the Run in Sleep mode feature exists on the USART module.
6962  Description:
6963  This function identifies whether the Run in Sleep mode feature is
6964  available on the USART module. When this function returns true, these
6965  functions are supported on the device:
6966  - PLIB_USART_RunInSleepModeEnable
6967  - PLIB_USART_RunInSleepModeDisable
6968  - PLIB_USART_RunInSleepModeIsEnabled
6969  This operation is atomic.
6970  Preconditions:
6971  None.
6972  Parameters:
6973  index - Identifier for the device instance
6974  Returns:
6975  - true - The Run in Sleep mode feature is supported on the device
6976  - false - The Run in Sleep mode feature is not supported on the device
6977  Remarks:
6978  None.
6979 */
6980 
6981 bool
6983  USART_MODULE_ID index ) ;
6984 //******************************************************************************
6985 /* Function:
6986  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
6987  Summary:
6988  Identifies whether the EnableControl feature exists on the USART module.
6989  Description:
6990  This function identifies whether the EnableControl feature is
6991  available on the USART module. When this function returns true, these
6992  functions are supported on the device:
6993  - PLIB_USART_Disable
6994  - PLIB_USART_Enable
6995  This operation is atomic.
6996  Preconditions:
6997  None.
6998  Parameters:
6999  index - Identifier for the device instance
7000  Returns:
7001  - true - The EnableControl feature is supported on the device
7002  - false - The EnableControl feature is not supported on the device
7003  Remarks:
7004  None.
7005 */
7006 
7007 bool
7009  USART_MODULE_ID index ) ;
7010 //******************************************************************************
7011 /* Function:
7012  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7013  Summary:
7014  Identifies whether the HandShakeMode feature exists on the USART module.
7015  Description:
7016  This function identifies whether the HandShakeMode feature is
7017  available on the USART module. When this function returns true, this
7018  function is supported on the device:
7019  - PLIB_USART_HandshakeModeSelect
7020  This operation is atomic.
7021  Preconditions:
7022  None.
7023  Parameters:
7024  index - Identifier for the device instance
7025  Returns:
7026  - true - The HandShakeMode feature is supported on the device
7027  - false - The HandShakeMode feature is not supported on the device
7028  Remarks:
7029  None.
7030 */
7031 
7032 bool
7034  USART_MODULE_ID index ) ;
7035 //******************************************************************************
7036 /* Function:
7037  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7038  Summary:
7039  Identifies whether the IrDAControl feature exists on the USART module.
7040  Description:
7041  This function identifies whether the IrDAControl feature is
7042  available on the USART module. When this function returns true, these
7043  functions are supported on the device:
7044  - PLIB_USART_IrDADisable
7045  - PLIB_USART_IrDAEnable
7046  This operation is atomic.
7047  Preconditions:
7048  None.
7049  Parameters:
7050  index - Identifier for the device instance
7051  Returns:
7052  - true - The IrDAControl feature is supported on the device
7053  - false - The IrDAControl feature is not supported on the device
7054  Remarks:
7055  None.
7056 */
7057 
7058 bool
7060  USART_MODULE_ID index ) ;
7061 //******************************************************************************
7062 /* Function:
7063  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7064  Summary:
7065  Identifies whether the LineControlMode feature exists on the USART module.
7066  Description:
7067  This function identifies whether the LineControlMode feature is
7068  available on the USART module. When this function returns true, this
7069  function is supported on the device:
7070  - PLIB_USART_LineControlModeSelect
7071  This operation is atomic.
7072  Preconditions:
7073  None.
7074  Parameters:
7075  index - Identifier for the device instance
7076  Returns:
7077  - true - The LineControlMode feature is supported on the device
7078  - false - The LineControlMode feature is not supported on the device
7079  Remarks:
7080  None.
7081 */
7082 
7083 bool
7085  USART_MODULE_ID index ) ;
7086 //******************************************************************************
7087 /* Function:
7088  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7089  Summary:
7090  Identifies whether the Loopback feature exists on the USART module.
7091  Description:
7092  This function identifies whether the Loopback feature is
7093  available on the USART module. When this function returns true, these
7094  functions are supported on the device:
7095  - PLIB_USART_LoopbackEnable
7096  - PLIB_USART_LoopbackDisable
7097  This operation is atomic.
7098  Preconditions:
7099  None.
7100  Parameters:
7101  index - Identifier for the device instance
7102  Returns:
7103  - true - The Loopback feature is supported on the device
7104  - false - The Loopback feature is not supported on the device
7105  Remarks:
7106  None.
7107 */
7108 
7109 bool
7111  USART_MODULE_ID index ) ;
7112 //******************************************************************************
7113 /* Function:
7114  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7115  Summary:
7116  Identifies whether the OperationMode feature exists on the USART module.
7117  Description:
7118  This function identifies whether the OperationMode feature is
7119  available on the USART module. When this function returns true, this
7120  function is supported on the device:
7121  - PLIB_USART_OperationModeSelect
7122  This operation is atomic.
7123  Preconditions:
7124  None.
7125  Parameters:
7126  index - Identifier for the device instance
7127  Returns:
7128  - true - The OperationMode feature is supported on the device
7129  - false - The OperationMode feature is not supported on the device
7130  Remarks:
7131  None.
7132 */
7133 
7134 bool
7136  USART_MODULE_ID index ) ;
7137 //******************************************************************************
7138 /* Function:
7139  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7140  Summary:
7141  Identifies whether the StopInIdle feature exists on the USART module.
7142  Description:
7143  This function identifies whether the StopInIdle feature is
7144  available on the USART module. When this function returns true, these
7145  functions are supported on the device:
7146  - PLIB_USART_StopInIdleEnable
7147  - PLIB_USART_StopInIdleDisable
7148  This operation is atomic.
7149  Preconditions:
7150  None.
7151  Parameters:
7152  index - Identifier for the device instance
7153  Returns:
7154  - true - The StopInIdle feature is supported on the device
7155  - false - The StopInIdle feature is not supported on the device
7156  Remarks:
7157  None.
7158 */
7159 
7160 bool
7162  USART_MODULE_ID index ) ;
7163 //******************************************************************************
7164 /* Function:
7165  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7166  Summary:
7167  Identifies whether the WakeOnStart feature exists on the USART module.
7168  Description:
7169  This function identifies whether the WakeOnStart feature is
7170  available on the USART module. When this function returns true, these
7171  functions are supported on the device:
7172  - PLIB_USART_WakeOnStartEnable
7173  - PLIB_USART_WakeOnStartDisable
7174  - PLIB_USART_WakeOnStartIsEnabled
7175  This operation is atomic.
7176  Preconditions:
7177  None.
7178  Parameters:
7179  index - Identifier for the device instance
7180  Returns:
7181  - true - The WakeOnStart feature is supported on the device
7182  - false - The WakeOnStart feature is not supported on the device
7183  Remarks:
7184  None.
7185 */
7186 
7187 bool
7189  USART_MODULE_ID index ) ;
7190 //******************************************************************************
7191 /* Function:
7192  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7193  Summary:
7194  Identifies whether the BaudRate feature exists on the USART module.
7195  Description:
7196  This function identifies whether the BaudRate feature is
7197  available on the USART module. When this function returns true, these
7198  functions are supported on the device:
7199  - PLIB_USART_BaudRateSet
7200  - PLIB_USART_BaudRateGet
7201  This operation is atomic.
7202  Preconditions:
7203  None.
7204  Parameters:
7205  index - Identifier for the device instance
7206  Returns:
7207  - true - The BaudRate feature is supported on the device
7208  - false - The BaudRate feature is not supported on the device
7209  Remarks:
7210  None.
7211 */
7212 
7213 bool
7215  USART_MODULE_ID index ) ;
7216 //******************************************************************************
7217 /* Function:
7218  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7219  Summary:
7220  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7221  Description:
7222  This function identifies whether the BaudRateAutoDetect feature is
7223  available on the USART module. When this function returns true, these
7224  functions are supported on the device:
7225  - PLIB_USART_BaudRateAutoDetectEnable
7226  - PLIB_USART_BaudRateAutoDetectIsComplete
7227  This operation is atomic.
7228  Preconditions:
7229  None.
7230  Parameters:
7231  index - Identifier for the device instance
7232  Returns:
7233  - true - The BaudRateAutoDetect feature is supported on the device
7234  - false - The BaudRateAutoDetect feature is not supported on the device
7235  Remarks:
7236  None.
7237 */
7238 
7239 bool
7241  USART_MODULE_ID index ) ;
7242 //******************************************************************************
7243 /* Function:
7244  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7245  Summary:
7246  Identifies whether the BaudRateHigh feature exists on the USART module.
7247  Description:
7248  This function identifies whether the BaudRateHigh feature is
7249  available on the USART module. When this function returns true, these
7250  functions are supported on the device:
7251  - PLIB_USART_BaudRateHighSet
7252  - PLIB_USART_BaudRateHighDisable
7253  - PLIB_USART_BaudRateHighEnable
7254  This operation is atomic.
7255  Preconditions:
7256  None.
7257  Parameters:
7258  index - Identifier for the device instance
7259  Returns:
7260  - true - The BaudRateHigh feature is supported on the device
7261  - false - The BaudRateHigh feature is not supported on the device
7262  Remarks:
7263  None.
7264 */
7265 
7266 bool
7268  USART_MODULE_ID index ) ;
7269 //******************************************************************************
7270 /* Function:
7271  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7272  Summary:
7273  Identifies whether the Receiver Address feature exists on the USART
7274  module.
7275  Description:
7276  This function identifies whether the Receiver Address feature is
7277  available on the USART module. When this function returns true, these
7278  functions are supported on the device:
7279  - PLIB_USART_AddressSet
7280  - PLIB_USART_AddressGet
7281  This operation is atomic.
7282  Preconditions:
7283  None.
7284  Parameters:
7285  index - Identifier for the device instance
7286  Returns:
7287  - true - The Receiver address feature is supported on the device
7288  - false - The Receiver address feature is not supported on the device
7289  Remarks:
7290  None.
7291 */
7292 
7293 bool
7295  USART_MODULE_ID index ) ;
7296 //******************************************************************************
7297 /* Function:
7298  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7299  Summary:
7300  Identifies whether the Receiver Address Mask feature exists on the USART
7301  module.
7302  Description:
7303  This function identifies whether the Receiver Address Mask feature is
7304  available on the USART module. When this function returns true, these
7305  functions are supported on the device:
7306  - PLIB_USART_AddressMaskSet
7307  - PLIB_USART_AddressMaskGet
7308  This operation is atomic.
7309  Preconditions:
7310  None.
7311  Parameters:
7312  index - Identifier for the device instance
7313  Returns:
7314  - true - The Receiver address mask feature is supported on the device
7315  - false - The Receiver address mask feature is not supported on the device
7316  Remarks:
7317  None.
7318 */
7319 
7320 bool
7322  USART_MODULE_ID index ) ;
7323 //******************************************************************************
7324 /* Function:
7325  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7326  Summary:
7327  Identifies whether the Receiver feature exists on the USART module.
7328  Description:
7329  This function identifies whether the Receiver feature is available on the
7330  USART module. When this function returns true, these functions are supported
7331  on the device:
7332  - PLIB_USART_ReceiverByteReceive
7333  - PLIB_USART_ReceiverAddressGet
7334  This operation is atomic.
7335  Preconditions:
7336  None.
7337  Parameters:
7338  index - Identifier for the device instance
7339  Returns:
7340  - true - The Receiver feature is supported on the device
7341  - false - The Receiver feature is not supported on the device
7342  Remarks:
7343  None.
7344 */
7345 
7346 bool
7348  USART_MODULE_ID index ) ;
7349 //******************************************************************************
7350 /* Function:
7351  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7352  Summary:
7353  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7354  Description:
7355  This function identifies whether the 9 Bits Receiver feature is available on the
7356  USART module. When this function returns true, this function is supported
7357  on the device:
7358  - PLIB_USART_Receiver9BitsReceive
7359  This operation is atomic.
7360  Preconditions:
7361  None.
7362  Parameters:
7363  index - Identifier for the device instance
7364  Returns:
7365  - true - The feature is supported on the device
7366  - false - The feature is not supported on the device
7367  Remarks:
7368  None.
7369 */
7370 
7371 bool
7373  USART_MODULE_ID index ) ;
7374 //******************************************************************************
7375 /* Function:
7376  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7377  Summary:
7378  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7379  Description:
7380  This function identifies whether the ReceiverAddressAutoDetect feature is
7381  available on the USART module. When this function returns true, these
7382  functions are supported on the device:
7383  - PLIB_USART_ReceiverAddressAutoDetectEnable
7384  - PLIB_USART_ReceiverAddressAutoDetectDisable
7385  This operation is atomic.
7386  Preconditions:
7387  None.
7388  Parameters:
7389  index - Identifier for the device instance
7390  Returns:
7391  - true - The ReceiverAddressAutoDetect feature is supported on the device
7392  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7393  Remarks:
7394  None.
7395 */
7396 
7397 bool
7399  USART_MODULE_ID index ) ;
7400 //******************************************************************************
7401 /* Function:
7402  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7403  Summary:
7404  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7405  Description:
7406  This function identifies whether the ReceiverAddressDetect feature is
7407  available on the USART module. When this function returns true, these
7408  functions are supported on the device:
7409  - PLIB_USART_ReceiverAddressDetectEnable
7410  - PLIB_USART_ReceiverAddressDetectDisable
7411  - PLIB_USART_ReceiverAddressIsReceived
7412  This operation is atomic.
7413  Preconditions:
7414  None.
7415  Parameters:
7416  index - Identifier for the device instance
7417  Returns:
7418  - true - The ReceiverAddressDetect feature is supported on the device
7419  - false - The ReceiverAddressDetect feature is not supported on the device
7420  Remarks:
7421  None.
7422 */
7423 
7424 bool
7426  USART_MODULE_ID index ) ;
7427 //******************************************************************************
7428 /* Function:
7429  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7430  Summary:
7431  Identifies whether the ReceiverDataAvailable feature exists on the USART
7432  module
7433  Description:
7434  This function identifies whether the ReceiverDataAvailable feature is
7435  available on the USART module. When this function returns true, this
7436  function is supported on the device:
7437  - PLIB_USART_ReceiverDataIsAvailable
7438  This operation is atomic.
7439  Preconditions:
7440  None.
7441  Parameters:
7442  index - Identifier for the device instance
7443  Returns:
7444  - true - The ReceiverDataAvailable feature is supported on the device
7445  - false - The ReceiverDataAvailable feature is not supported on the device
7446  Remarks:
7447  None.
7448 */
7449 
7450 bool
7452  USART_MODULE_ID index ) ;
7453 //******************************************************************************
7454 /* Function:
7455  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7456  Summary:
7457  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7458  Description:
7459  This function identifies whether the ReceiverEnableControl feature is
7460  available on the USART module. When this function returns true, these
7461  functions are supported on the device:
7462  - PLIB_USART_ReceiverEnable
7463  - PLIB_USART_ReceiverDisable
7464  This operation is atomic.
7465  Preconditions:
7466  None.
7467  Parameters:
7468  index - Identifier for the device instance
7469  Returns:
7470  - true - The ReceiverEnableControl feature is supported on the device
7471  - false - The ReceiverEnableControl feature is not supported on the device
7472  Remarks:
7473  None.
7474 */
7475 
7476 bool
7478  USART_MODULE_ID index ) ;
7479 //******************************************************************************
7480 /* Function:
7481  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7482  Summary:
7483  Identifies whether the ReceiverIdle feature exists on the USART module.
7484  Description:
7485  This function identifies whether the ReceiverIdle feature is
7486  available on the USART module. When this function returns true, this
7487  function is supported on the device:
7488  - PLIB_USART_ReceiverIsIdle
7489  This operation is atomic.
7490  Preconditions:
7491  None.
7492  Parameters:
7493  index - Identifier for the device instance
7494  Returns:
7495  - true - The ReceiverIdle feature is supported on the device
7496  - false - The ReceiverIdle feature is not supported on the device
7497  Remarks:
7498  None.
7499 */
7500 
7501 bool
7503  USART_MODULE_ID index ) ;
7504 //******************************************************************************
7505 /* Function:
7506  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7507  Summary:
7508  Identifies whether the ReceiverFramingError feature exists on the USART module.
7509  Description:
7510  This function identifies whether the ReceiverFramingError feature is
7511  available on the USART module. When this function returns true, this
7512  function is supported on the device:
7513  - PLIB_USART_ReceiverFramingErrorHasOccurred
7514  This operation is atomic.
7515  Preconditions:
7516  None.
7517  Parameters:
7518  index - Identifier for the device instance
7519  Returns:
7520  - true - The ReceiverFramingError feature is supported on the device
7521  - false - The ReceiverFramingError feature is not supported on the device
7522  Remarks:
7523  None.
7524 */
7525 
7526 bool
7528  USART_MODULE_ID index ) ;
7529 //******************************************************************************
7530 /* Function:
7531  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7532  Summary:
7533  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7534  Description:
7535  This function identifies whether the ReceiverInterruptMode feature is
7536  available on the USART module. When this function returns true, this
7537  function is supported on the device:
7538  - PLIB_USART_ReceiverInterruptModeSelect
7539  This operation is atomic.
7540  Preconditions:
7541  None.
7542  Parameters:
7543  index - Identifier for the device instance
7544  Returns:
7545  - true - The ReceiverInterruptMode feature is supported on the device
7546  - false - The ReceiverInterruptMode feature is not supported on the device
7547  Remarks:
7548  None.
7549 */
7550 
7551 bool
7553  USART_MODULE_ID index ) ;
7554 //******************************************************************************
7555 /* Function:
7556  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
7557  Summary:
7558  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
7559  Description:
7560  This function identifies whether the ReceiverPolarityInvert feature is
7561  available on the USART module. When this function returns true, these
7562  functions are supported on the device:
7563  - PLIB_USART_ReceiverIdleStateLowEnable
7564  - PLIB_USART_ReceiverIdleStateLowDisable
7565  This operation is atomic.
7566  Preconditions:
7567  None.
7568  Parameters:
7569  index - Identifier for the device instance
7570  Returns:
7571  - true - The ReceiverPolarityInvert feature is supported on the device
7572  - false - The ReceiverPolarityInvert feature is not supported on the device
7573  Remarks:
7574  None.
7575 */
7576 
7577 bool
7579  USART_MODULE_ID index ) ;
7580 //******************************************************************************
7581 /* Function:
7582  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
7583  Summary:
7584  Identifies whether the ReceiverParityError feature exists on the USART module.
7585  Description:
7586  This function identifies whether the ReceiverParityError feature is
7587  available on the USART module. When this function returns true, this
7588  function is supported on the device:
7589  - PLIB_USART_ReceiverParityErrorHasOccurred
7590  This operation is atomic.
7591  Preconditions:
7592  None.
7593  Parameters:
7594  index - Identifier for the device instance
7595  Returns:
7596  - true - The ReceiverParityError feature is supported on the device
7597  - false - The ReceiverParityError feature is not supported on the device
7598  Remarks:
7599  None.
7600 */
7601 
7602 bool
7604  USART_MODULE_ID index ) ;
7605 //******************************************************************************
7606 /* Function:
7607  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
7608  Summary:
7609  Identifies whether the ReceiverOverrunError feature exists on the USART module.
7610  Description:
7611  This function identifies whether the ReceiverOverrunError feature is
7612  available on the USART module. When this function returns true, these
7613  functions are supported on the device:
7614  - PLIB_USART_ReceiverOverrunErrorClear
7615  - PLIB_USART_ReceiverOverrunHasOccurred
7616  This operation is atomic.
7617  Preconditions:
7618  None.
7619  Parameters:
7620  index - Identifier for the device instance
7621  Returns:
7622  - true - The ReceiverOverrunError feature is supported on the device
7623  - false - The ReceiverOverrunError feature is not supported on the device
7624  Remarks:
7625  None.
7626 */
7627 
7628 bool
7630  USART_MODULE_ID index ) ;
7631 //******************************************************************************
7632 /* Function:
7633  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
7634  Summary:
7635  Identifies whether the Transmitter feature exists on the USART module.
7636  Description:
7637  This function identifies whether the Transmitter feature is
7638  available on the USART module. When this function returns true, these
7639  functions are supported on the device:
7640  - PLIB_USART_TransmitterByteSend
7641  - PLIB_USART_TransmitterAddressGet
7642  This operation is atomic.
7643  Preconditions:
7644  None.
7645  Parameters:
7646  index - Identifier for the device instance
7647  Returns:
7648  - true - The Transmitter feature is supported on the device
7649  - false - The Transmitter feature is not supported on the device
7650  Remarks:
7651  None.
7652 */
7653 
7654 bool
7656  USART_MODULE_ID index ) ;
7657 //******************************************************************************
7658 /* Function:
7659  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
7660  Summary:
7661  Identifies whether the Transmitter9Bits feature exists on the USART module.
7662  Description:
7663  This function identifies whether the Transmitter9Bits feature is
7664  available on the USART module. When this function returns true, this
7665  function is supported on the device:
7666  - PLIB_USART_Transmitter9BitsSend
7667  This operation is atomic.
7668  Preconditions:
7669  None.
7670  Parameters:
7671  index - Identifier for the device instance
7672  Returns:
7673  - true - The Transmitter9Bits feature is supported on the device
7674  - false - The Transmitter9Bits feature is not supported on the device
7675  Remarks:
7676  None.
7677 */
7678 
7679 bool
7681  USART_MODULE_ID index ) ;
7682 //******************************************************************************
7683 /* Function:
7684  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
7685  Summary:
7686  Identifies whether the TransmitterBreak feature exists on the USART module.
7687  Description:
7688  This function identifies whether the TransmitterBreak feature is
7689  available on the USART module. When this function returns true, these
7690  functions are supported on the device:
7691  - PLIB_USART_TransmitterBreakSend
7692  - PLIB_USART_TransmitterBreakSendIsComplete
7693  This operation is atomic.
7694  Preconditions:
7695  None.
7696  Parameters:
7697  index - Identifier for the device instance
7698  Returns:
7699  - true - The TransmitterBreak feature is supported on the device
7700  - false - The TransmitterBreak feature is not supported on the device
7701  Remarks:
7702  None.
7703 */
7704 
7705 bool
7707  USART_MODULE_ID index ) ;
7708 //******************************************************************************
7709 /* Function:
7710  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
7711  Summary:
7712  Identifies whether the TransmitterBufferFull feature exists on the USART module.
7713  Description:
7714  This function identifies whether the TransmitterBufferFull feature is
7715  available on the USART module. When this function returns true, this
7716  function is supported on the device:
7717  - PLIB_USART_TransmitterBufferIsFull
7718  This operation is atomic.
7719  Preconditions:
7720  None.
7721  Parameters:
7722  index - Identifier for the device instance
7723  Returns:
7724  - true - The TransmitterBufferFull feature is supported on the device
7725  - false - The TransmitterBufferFull feature is not supported on the device
7726  Remarks:
7727  None.
7728 */
7729 
7730 bool
7732  USART_MODULE_ID index ) ;
7733 //******************************************************************************
7734 /* Function:
7735  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
7736  Summary:
7737  Identifies whether the TransmitterEmpty feature exists on the USART module.
7738  Description:
7739  This function identifies whether the TransmitterEmpty feature is
7740  available on the USART module. When this function returns true, this
7741  function is supported on the device:
7742  - PLIB_USART_TransmitterIsEmpty
7743  This operation is atomic.
7744  Preconditions:
7745  None.
7746  Parameters:
7747  index - Identifier for the device instance
7748  Returns:
7749  - true - The TransmitterEmpty feature is supported on the device
7750  - false - The TransmitterEmpty feature is not supported on the device
7751  Remarks:
7752  None.
7753 */
7754 
7755 bool
7757  USART_MODULE_ID index ) ;
7758 //******************************************************************************
7759 /* Function:
7760  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
7761  Summary:
7762  Identifies whether the TransmitterEnableControl feature exists on the USART
7763  module
7764  Description:
7765  This function identifies whether the TransmitterEnableControl feature is
7766  available on the USART module. When this function returns true, these
7767  functions are supported on the device:
7768  - PLIB_USART_TransmitterEnable
7769  - PLIB_USART_TransmitterDisable
7770  This operation is atomic.
7771  Preconditions:
7772  None.
7773  Parameters:
7774  index - Identifier for the device instance
7775  Returns:
7776  - true - The TransmitterEnableControl feature is supported on the device
7777  - false - The TransmitterEnableControl feature is not supported on the device
7778  Remarks:
7779  None.
7780 */
7781 
7782 bool
7784  USART_MODULE_ID index ) ;
7785 //******************************************************************************
7786 /* Function:
7787  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
7788  Summary:
7789  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
7790  Description:
7791  This function identifies whether the TransmitterInterruptMode feature is
7792  available on the USART module. When this function returns true, this function
7793  is supported on the device:
7794  - PLIB_USART_TransmitterInterruptModeSelect
7795  This operation is atomic.
7796  Preconditions:
7797  None.
7798  Parameters:
7799  index - Identifier for the device instance
7800  Returns:
7801  - true - The TransmitterInterruptMode feature is supported on the device
7802  - false - The TransmitterInterruptMode feature is not supported on the device
7803  Remarks:
7804  None.
7805 */
7806 
7807 bool
7809  USART_MODULE_ID index ) ;
7810 //******************************************************************************
7811 /* Function:
7812  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
7813  Summary:
7814  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
7815  Description:
7816  This function identifies whether the TransmitterIdleIsLow feature is available
7817  on the USART module. When this function returns true, these functions are
7818  supported on the device:
7819  - PLIB_USART_TransmitterIdleIsLowDisable
7820  - PLIB_USART_TransmitterIdleIsLowEnable
7821  This operation is atomic.
7822  Preconditions:
7823  None.
7824  Parameters:
7825  index - Identifier for the device instance
7826  Returns:
7827  - true - The TransmitterIdleIsLow feature is supported on the device
7828  - false - The TransmitterIdleIsLow feature is not supported on the device
7829  Remarks:
7830  None.
7831 */
7832 
7833 bool
7835  USART_MODULE_ID index ) ;
7836 //DOM-IGNORE-BEGIN
7837 //DOM-IGNORE-END
7838  // #ifndef _PLIB_USART_H
7839 /******************************************************************************
7840  End of File
7841 */
7842 
7843 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
7844 /* CLOSE_FILE Include File */
7845 
7846 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
7847 /*******************************************************************************
7848  System Services Library Interface Header
7849  Company:
7850  Microchip Technology Inc.
7851  File Name:
7852  system.h
7853  Summary:
7854  Top level common system services library interface header.
7855  Description:
7856  This file is the top level common system services library interface header.
7857  It defines (or includes files that define) the common system service
7858  types, prototypes, and other definitions that are commonly used by MPLAB
7859  Harmony libraries and system services.
7860 
7861  System services provide common functionality that would otherwise need to
7862  be duplicated by multiple other modules or that would force them to
7863  interact in complex and hard to manage ways. System services eliminate
7864  conflicts by controlling access shared resources.
7865  Remarks:
7866  The parent directory to the "system" directory should be added to the
7867  compiler's search path for header files such that the following include
7868  statment will successfully include this file.
7869 
7870 #include "system/system.h"
7871  *******************************************************************************/
7872 //DOM-IGNORE-BEGIN
7873 /*******************************************************************************
7874 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
7875 Microchip licenses to you the right to use, modify, copy and distribute
7876 Software only when embedded on a Microchip microcontroller or digital signal
7877 controller that is integrated into your product or third party product
7878 (pursuant to the sublicense terms in the accompanying license agreement).
7879 You should refer to the license agreement accompanying this Software for
7880 additional information regarding your rights and obligations.
7881 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
7882 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7883 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7884 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7885 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7886 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7887 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7888 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7889 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7890 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7891  *******************************************************************************/
7892 //DOM-IGNORE-END
7893 #ifndef _SYSTEM_H
7894 #define _SYSTEM_H
7895 // *****************************************************************************
7896 // *****************************************************************************
7897 // Section: Included Files
7898 // *****************************************************************************
7899 // *****************************************************************************
7900 #include "system/common/sys_common.h"
7901 #include "system/common/sys_module.h"
7902 // DOM-IGNORE-BEGIN
7903 // DOM-IGNORE-END
7904 //DOM-IGNORE-BEGIN
7905 //DOM-IGNORE-END
7906  // _SYSTEM_H
7907 /*******************************************************************************
7908  End of File
7909 */
7910 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
7911 /* CLOSE_FILE Include File */
7912 
7913 #include "system/int/sys_int.h"
7914 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
7915 /*******************************************************************************
7916  DMA System Service Library Interface Definition
7917  Company:
7918  Microchip Technology Inc.
7919  File Name:
7920  sys_dma.h
7921  Summary:
7922  DMA System Service.
7923  Description:
7924  This file contains the interface definition for the DMA System
7925  Service. It provides a way to interact with the DMA subsystem to
7926  manage the data transfer between different peripherals and/or memory
7927  without intervention from the CPU.
7928 *******************************************************************************/
7929 //DOM-IGNORE-BEGIN
7930 /*******************************************************************************
7931 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7932 Microchip licenses to you the right to use, modify, copy and distribute
7933 Software only when embedded on a Microchip microcontroller or digital signal
7934 controller that is integrated into your product or third party product
7935 (pursuant to the sublicense terms in the accompanying license agreement).
7936 You should refer to the license agreement accompanying this Software for
7937 additional information regarding your rights and obligations.
7938 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7939 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7940 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7941 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7942 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7943 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7944 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7945 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7946 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7947 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7948 *******************************************************************************/
7949 //DOM-IGNORE-END
7950 #ifndef _SYS_DMA_H
7951 #define _SYS_DMA_H
7952 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
7953 /*******************************************************************************
7954  DMA System Service Library Interface Definition
7955  Company:
7956  Microchip Technology Inc.
7957  File Name:
7958  sys_dma_definitions.h
7959  Summary:
7960  DMA System Service data type definitions header.
7961  Description:
7962  This file contains data type definitions header.
7963 *******************************************************************************/
7964 //DOM-IGNORE-BEGIN
7965 /*******************************************************************************
7966 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7967 Microchip licenses to you the right to use, modify, copy and distribute
7968 Software only when embedded on a Microchip microcontroller or digital signal
7969 controller that is integrated into your product or third party product
7970 (pursuant to the sublicense terms in the accompanying license agreement).
7971 You should refer to the license agreement accompanying this Software for
7972 additional information regarding your rights and obligations.
7973 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7974 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7975 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7976 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7977 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7978 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7979 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7980 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7981 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7982 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7983 *******************************************************************************/
7984 //DOM-IGNORE-END
7985 #ifndef _SYS_DMA_DEFINITIONS_H
7986 #define _SYS_DMA_DEFINITIONS_H
7987 // *****************************************************************************
7988 // *****************************************************************************
7989 // Section: File includes
7990 // *****************************************************************************
7991 // *****************************************************************************
7992 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
7993 #include "system/common/sys_common.h"
7994 #include "system/common/sys_module.h"
7995 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
7996 /*******************************************************************************
7997  DMA Peripheral Library Interface Header
7998  Company:
7999  Microchip Technology Inc.
8000  File Name:
8001  plib_dma.h
8002  Summary:
8003  Defines the DMA Peripheral Library interface functions.
8004  Description:
8005  This header file contains the function prototypes and definitions of
8006  the data types and constants that make up the interface to the Direct Memory
8007  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8008  definitions in this file are for the DMA module.
8009 *******************************************************************************/
8010 // DOM-IGNORE-BEGIN
8011 /*******************************************************************************
8012 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8013 Microchip licenses to you the right to use, modify, copy and distribute
8014 Software only when embedded on a Microchip microcontroller or digital signal
8015 controller that is integrated into your product or third party product
8016 (pursuant to the sublicense terms in the accompanying license agreement).
8017 You should refer to the license agreement accompanying this Software for
8018 additional information regarding your rights and obligations.
8019 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8020 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8021 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8022 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8023 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8024 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8025 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8026 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8027 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8028 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8029 *******************************************************************************/
8030 // DOM-IGNORE-END
8031 #ifndef _PLIB_DMA_H
8032 #define _PLIB_DMA_H
8033 // DOM-IGNORE-BEGIN
8034 // DOM-IGNORE-END
8035 // *****************************************************************************
8036 // *****************************************************************************
8037 // Section: Includes
8038 // *****************************************************************************
8039 // *****************************************************************************
8040 /* See Bottom of file for implementation header include files.
8041 */
8042 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8043 //DOM-IGNORE-BEGIN
8044 /*******************************************************************************
8045 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8046 Microchip licenses to you the right to use, modify, copy and distribute
8047 Software only when embedded on a Microchip microcontroller or digital signal
8048 controller that is integrated into your product or third party product
8049 (pursuant to the sublicense terms in the accompanying license agreement).
8050 You should refer to the license agreement accompanying this Software for
8051 additional information regarding your rights and obligations.
8052 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8053 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8054 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8055 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8056 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8057 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8058 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8059 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8060 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8061 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8062  *******************************************************************************/
8063 //DOM-IGNORE-END
8064 #ifndef _PLIB_DMA_PROCESSOR_H
8065 #define _PLIB_DMA_PROCESSOR_H
8066 #error "Can't find header"
8067 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8068 /* CLOSE_FILE Include File */
8069 
8070 // *****************************************************************************
8071 // *****************************************************************************
8072 // Section: Peripheral Library Interface Functions
8073 // *****************************************************************************
8074 // *****************************************************************************
8075 // *****************************************************************************
8076 // *****************************************************************************
8077 // Section: DMA Channel Status Functions
8078 // *****************************************************************************
8079 // *****************************************************************************
8080 //******************************************************************************
8081 /* Function:
8082  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8083  DMA_CHANNEL channel )
8084  Summary:
8085  Returns the buffered data write status for the specified channel.
8086  Description:
8087  This function returns the buffered data write status for the specified channel.
8088  Precondition:
8089  None.
8090  Parameters:
8091  channel - One of the existing DMA channels listed by DMA_CHANNEL
8092  Returns:
8093  - true - The content of the DMA buffer has not been written to the location
8094  specified in the destination/source address or in Null Write mode
8095  - false - The content of the DMA buffer has been written to the location
8096  specified in the destination/source address or in Null Write mode
8097  Example:
8098  <code>
8099  bool chBuffWriteStatus;
8100  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8101  DMA_CHANNEL_3 );
8102  </code>
8103  Remarks:
8104  This feature is not available on all devices. Please refer to the specific device
8105  data sheet to determine availability.
8106 */
8107 
8108 bool
8110  DMA_MODULE_ID index ,
8111  DMA_CHANNEL channel ) ;
8112 /*******************************************************************************
8113  Function:
8114  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8115  DMA_CHANNEL channel,
8116  DMA_CHANNEL_COLLISION collisonType )
8117  Summary:
8118  Returns the status of the specified collision type for the specified channel.
8119  Description:
8120  This function returns the status of the specified collision type for the
8121  specified channel.
8122  Precondition:
8123  None.
8124  Parameters:
8125  channel - One of the existing DMA channels listed by DMA_CHANNEL
8126  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8127  Returns:
8128  - true - A collision specified by collisonType was detected
8129  - false - No collision of type collisonType was detected
8130  Example:
8131  <code>
8132  bool memWriteCollisionStatus;
8133  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8134  DMA_ID_0,
8135  DMA_CHANNEL_3,
8136  DMA_CHANNEL_COLLISION_MEMORY );
8137  </code>
8138  Remarks:
8139  This feature is not available on all devices. Please refer to the specific
8140  device data sheet to determine availability.
8141 */
8142 
8143 bool
8145  DMA_MODULE_ID index ,
8146  DMA_CHANNEL channel ,
8147  DMA_CHANNEL_COLLISION collisonType ) ;
8148 //******************************************************************************
8149 /* Function:
8150  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8151  DMA_CHANNEL channel )
8152  Summary:
8153  Returns the Ping-Pong mode status for the specified channel.
8154  Description:
8155  This function returns the Ping-Pong mode status for the specified channel.
8156  Precondition:
8157  None.
8158  Parameters:
8159  channel - One of the existing DMA channels listed by DMA_CHANNEL
8160  Returns:
8161  mode - One of the possible Ping-Pong modes
8162  Example:
8163  <code>
8164  DMA_PING_PONG_MODE chPingPongStatus;
8165  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8166  DMA_CHANNEL_3 );
8167  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8168  {
8169  \\Application
8170  }
8171  </code>
8172  Remarks:
8173  This feature is not available on all devices. Please refer to the specific
8174  device data sheet to determine availability.
8175 */
8176 
8177 DMA_PING_PONG_MODE
8179  DMA_MODULE_ID index ,
8180  DMA_CHANNEL channel ) ;
8181 //******************************************************************************
8182 /* Function:
8183  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8184  DMA_CHANNEL channel )
8185  Summary:
8186  Returns the event status on the specified channel.
8187  Description:
8188  This function returns the event status on the specified channel.
8189  Precondition:
8190  None.
8191  Parameters:
8192  channel - One of the possible DMA channels listed by DMA_CHANNEL
8193  Returns:
8194  - true - An event was detected
8195  - false - No events were detected
8196  Example:
8197  <code>
8198  bool channeleventStatus;
8199  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8200  DMA_CHANNEL_2 );
8201  </code>
8202  Remarks:
8203  This function implements an operation of the ChannelXEvent feature.
8204  This feature may not be available on all devices. Please refer to the
8205  specific device data sheet to determine availability or include the
8206  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8207  whether this feature is available.
8208 */
8209 
8210 bool
8212  DMA_MODULE_ID index ,
8213  DMA_CHANNEL channel ) ;
8214 // *****************************************************************************
8215 // *****************************************************************************
8216 // Section: DMA Channel Configuration Functions
8217 // *****************************************************************************
8218 // *****************************************************************************
8219 //******************************************************************************
8220 /* Function:
8221  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8222  DMA_CHANNEL channel,
8223  DMA_CHANNEL_PRIORITY channelPriority )
8224  Summary:
8225  Sets the priority of the specified channel.
8226  Description:
8227  This function sets the priority of the specified channel.
8228  Precondition:
8229  None.
8230  Parameters:
8231  channel - One of the existing DMA channels listed by DMA_CHANNEL
8232  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8233  Returns:
8234  None.
8235  Example:
8236  <code>
8237  DMA_CHANNEL channel = DMA_CHANNEL_0;
8238  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8239  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8240  </code>
8241  Remarks:
8242  This function implements an operation of the ChannelXPriority feature.
8243  This feature may not be available on all devices. Please refer to the
8244  specific device data sheet to determine availability or use the
8245  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8246  whether this feature is available.
8247 */
8248 
8249 void
8251  DMA_MODULE_ID index ,
8252  DMA_CHANNEL channel ,
8253  DMA_CHANNEL_PRIORITY channelPriority ) ;
8254 //******************************************************************************
8255 /* Function:
8256  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8257  DMA_CHANNEL channel )
8258  Summary:
8259  Gets the priority of the specified channel.
8260  Description:
8261  This function gets the priority of the specified channel.
8262  Precondition:
8263  None.
8264  Parameters:
8265  channel - One of the existing DMA channels listed by DMA_CHANNEL
8266  Returns:
8267  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8268  Example:
8269  <code>
8270  DMA_CHANNEL channel = DMA_CHANNEL_0;
8271  DMA_CHANNEL_PRIORITY channelPriority;
8272  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8273  </code>
8274  Remarks:
8275  This function implements an operation of the ChannelXPriority feature.
8276  This feature may not be available on all devices. Please refer to the
8277  specific device data sheet to determine availability or use the
8278  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8279  whether this feature is available.
8280 */
8281 
8282 DMA_CHANNEL_PRIORITY
8284  DMA_MODULE_ID index ,
8285  DMA_CHANNEL channel ) ;
8286 //******************************************************************************
8287 /* Function:
8288  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8289  DMA_CHANNEL_PRIORITY channelPriority )
8290  Summary:
8291  Sets the priority scheme of the DMA channels.
8292  Description:
8293  This function sets the priority scheme of the DMA channels at the global level.
8294  This function is used in devices that do not have the per channel priority feature.
8295  Precondition:
8296  None.
8297  Parameters:
8298  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8299  Returns:
8300  None.
8301  Example:
8302  <code>
8303  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8304  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8305  </code>
8306  Remarks:
8307  This feature is not available on all devices. Please refer to the specific
8308  device data sheet to determine availability.
8309 */
8310 
8311 void
8313  DMA_MODULE_ID index ,
8314  DMA_CHANNEL_PRIORITY channelPriority ) ;
8315 //******************************************************************************
8316 /* Function:
8317  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8318  Summary:
8319  Gets the priority scheme of the DMA channels.
8320  Description:
8321  This function gets the priority scheme of the DMA channels at the global level.
8322  This function is used in devices that do not have the per channel priority feature.
8323  Precondition:
8324  None.
8325  Parameters:
8326  None.
8327  Returns:
8328  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8329  Example:
8330  <code>
8331  DMA_CHANNEL_PRIORITY channelPriority;
8332  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8333  </code>
8334  Remarks:
8335  This feature is not available on all devices. Please refer to the specific
8336  device data sheet to determine availability.
8337 */
8338 
8339 DMA_CHANNEL_PRIORITY
8341  DMA_MODULE_ID index ) ;
8342 //******************************************************************************
8343 /* Function:
8344  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8345  DMA_CHANNEL channel )
8346  Summary:
8347  Channel is continuously enabled.
8348  Description:
8349  This function enables the channel continuously. The channel is not automatically
8350  disabled after a block transfer is complete.
8351  Precondition:
8352  None.
8353  Parameters:
8354  channel - One of the possible DMA channels listed by DMA_CHANNEL
8355  Returns:
8356  None.
8357  Example:
8358  <code>
8359  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8360  </code>
8361  Remarks:
8362  This function implements an operation of the ChannelXAuto feature.
8363  This feature may not be available on all devices. Please refer to the
8364  specific device data sheet to determine availability or use the
8365  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8366  whether this feature is available.
8367 */
8368 
8369 void
8371  DMA_MODULE_ID index ,
8372  DMA_CHANNEL channel ) ;
8373 //******************************************************************************
8374 /* Function:
8375  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8376  DMA_CHANNEL channel )
8377  Summary:
8378  Returns the channel automatic enable status.
8379  Description:
8380  This function returns the channel automatic enable status.
8381  Precondition:
8382  None.
8383  Parameters:
8384  channel - One of the possible DMA channels listed by DMA_CHANNEL
8385  Returns:
8386  - true - Channel automatic enable is on
8387  - false - Channel automatic enable is off
8388  Example:
8389  <code>
8390  bool ChAutoEnableStatus;
8391  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8392  </code>
8393  Remarks:
8394  This function implements an operation of the ChannelXAuto feature.
8395  This feature may not be available on all devices. Please refer to the
8396  specific device data sheet to determine availability or use the
8397  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8398  whether this feature is available.
8399 */
8400 
8401 bool
8403  DMA_MODULE_ID index ,
8404  DMA_CHANNEL channel ) ;
8405 //******************************************************************************
8406 /* Function:
8407  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8408  DMA_CHANNEL channel )
8409  Summary:
8410  Channel is disabled after a block transfer is complete.
8411  Description:
8412  This function disables a channel after a block transfer is complete.
8413  Precondition:
8414  None.
8415  Parameters:
8416  channel - One of the possible DMA channels listed by DMA_CHANNEL
8417  Returns:
8418  None.
8419  Example:
8420  <code>
8421  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8422  </code>
8423  Remarks:
8424  This function implements an operation of the ChannelXAuto feature.
8425  This feature may not be available on all devices. Please refer to the
8426  specific device data sheet to determine availability or use the
8427  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8428  whether this feature is available.
8429 */
8430 
8431 void
8433  DMA_MODULE_ID index ,
8434  DMA_CHANNEL channel ) ;
8435 //******************************************************************************
8436 /* Function:
8437  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8438  DMA_CHANNEL channel )
8439  Summary:
8440  Channel chain feature is enabled.
8441  Description:
8442  This function enables the channel chain feature.
8443  Precondition:
8444  None.
8445  Parameters:
8446  channel - One of the possible DMA channels listed by DMA_CHANNEL
8447  Returns:
8448  None.
8449  Example:
8450  <code>
8451  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8452  </code>
8453  Remarks:
8454  This function implements an operation of the ChannelXChainEnbl feature.
8455  This feature may not be available on all devices. Please refer to the
8456  specific device data sheet to determine availability or use the
8457  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8458  whether this feature is available.
8459 */
8460 
8461 void
8463  DMA_MODULE_ID index ,
8464  DMA_CHANNEL channel ) ;
8465 //******************************************************************************
8466 /* Function:
8467  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8468  DMA_CHANNEL channel )
8469  Summary:
8470  Returns the chain status of the specified channel.
8471  Description:
8472  This function returns the chain status of the specified channel.
8473  Precondition:
8474  None.
8475  Parameters:
8476  channel - One of the possible DMA channels listed by DMA_CHANNEL
8477  Returns:
8478  - true - The channel chain is on for this channel
8479  - false - The channel chain is off for this channel
8480  Example:
8481  <code>
8482  bool ChchainStatus;
8483  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8484  </code>
8485  Remarks:
8486  This function implements an operation of the ChannelXChainEnbl feature.
8487  This feature may not be available on all devices. Please refer to the
8488  specific device data sheet to determine availability or use the
8489  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8490  whether this feature is available.
8491 */
8492 
8493 bool
8495  DMA_MODULE_ID index ,
8496  DMA_CHANNEL channel ) ;
8497 //******************************************************************************
8498 /* Function:
8499  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8500  DMA_CHANNEL channel )
8501  Summary:
8502  Disables the channel chaining for the specified DMA channel.
8503  Description:
8504  This function disables the channel chaining for the specified DMA channel.
8505  Precondition:
8506  None.
8507  Parameters:
8508  channel - One of the possible DMA channels listed by DMA_CHANNEL
8509  Returns:
8510  None.
8511  Example:
8512  <code>
8513  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8514  </code>
8515  Remarks:
8516  This function implements an operation of the ChannelXChainEnbl feature.
8517  This feature may not be available on all devices. Please refer to the
8518  specific device data sheet to determine availability or use the
8519  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8520  whether this feature is available.
8521 */
8522 
8523 void
8525  DMA_MODULE_ID index ,
8526  DMA_CHANNEL channel ) ;
8527 //******************************************************************************
8528 /* Function:
8529  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8530  DMA_CHANNEL channel )
8531  Summary:
8532  Channel start/abort events will be registered even if the channel is
8533  disabled.
8534  Description:
8535  This function will allow the channel register start/abort events even if the
8536  channel is disabled.
8537  Precondition:
8538  None.
8539  Parameters:
8540  channel - One of the possible DMA channels listed by DMA_CHANNEL
8541  Returns:
8542  None.
8543  Example:
8544  <code>
8545  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8546  </code>
8547  Remarks:
8548  This function implements an operation of the ChannelXDisabled feature.
8549  This feature may not be available on all devices. Please refer to the
8550  specific device data sheet to determine availability or use the
8551  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8552  determine whether this feature is available.
8553 */
8554 
8555 void
8557  DMA_MODULE_ID index ,
8558  DMA_CHANNEL channel ) ;
8559 //******************************************************************************
8560 /* Function:
8561  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
8562  DMA_CHANNEL channel )
8563  Summary:
8564  Channel start/abort events will be ignored even if the channel is
8565  disabled.
8566  Description:
8567  This function will allow the channel start/abort events to be ignored even if
8568  the channel is disabled.
8569  Precondition:
8570  None.
8571  Parameters:
8572  channel - One of the possible DMA channels listed by DMA_CHANNEL
8573  Returns:
8574  None.
8575  Example:
8576  <code>
8577  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8578  </code>
8579  Remarks:
8580  This function implements an operation of the ChannelXDisabled feature.
8581  This feature may not be available on all devices. Please refer to the
8582  specific device data sheet to determine availability or use the
8583  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8584  determine whether this feature is available.
8585 */
8586 
8587 void
8589  DMA_MODULE_ID index ,
8590  DMA_CHANNEL channel ) ;
8591 //******************************************************************************
8592 /* Function:
8593  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
8594  DMA_CHANNEL channel )
8595  Summary:
8596  Enable the specified channel.
8597  Description:
8598  This function will enable the specified channel.
8599  Precondition:
8600  None.
8601  Parameters:
8602  channel - One of the possible DMA channels listed by DMA_CHANNEL
8603  Returns:
8604  None.
8605  Example:
8606  <code>
8607  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
8608  </code>
8609  Remarks:
8610  This function implements an operation of the ChannelX feature.
8611  This feature may not be available on all devices. Please refer to the
8612  specific device data sheet to determine availability or use the
8613  PLIB_DMA_ExistsChannelX function in your application to automatically
8614  determine whether this feature is available.
8615 */
8616 
8617 void
8619  DMA_MODULE_ID index ,
8620  DMA_CHANNEL channel ) ;
8621 //******************************************************************************
8622 /* Function:
8623  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
8624  DMA_CHANNEL channel )
8625  Summary:
8626  Return the enable status of the specified channel.
8627  Description:
8628  This function will return the enable status of the specified channel.
8629  Precondition:
8630  None.
8631  Parameters:
8632  channel - One of the possible DMA channels listed by DMA_CHANNEL
8633  Returns:
8634  - true - The specified DMA channel is enabled
8635  - false - The specified DMA channel is disabled
8636  Example:
8637  <code>
8638  bool chEnableStatus;
8639  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
8640  </code>
8641  Remarks:
8642  This function implements an operation of the ChannelX feature.
8643  This feature may not be available on all devices. Please refer to the
8644  specific device data sheet to determine availability or use the
8645  PLIB_DMA_ExistsChannelX function in your application to automatically
8646  determine whether this feature is available.
8647 */
8648 
8649 bool
8651  DMA_MODULE_ID index ,
8652  DMA_CHANNEL channel ) ;
8653 //******************************************************************************
8654 /* Function:
8655  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
8656  DMA_CHANNEL channel )
8657  Summary:
8658  Disable the specified channel.
8659  Description:
8660  This function will disable the specified channel.
8661  Precondition:
8662  None.
8663  Parameters:
8664  channel - One of the possible DMA channels listed by DMA_CHANNEL
8665  Returns:
8666  None.
8667  Example:
8668  <code>
8669  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
8670  </code>
8671  Remarks:
8672  This function implements an operation of the ChannelX feature.
8673  This feature may not be available on all devices. Please refer to the
8674  specific device data sheet to determine availability or use the
8675  PLIB_DMA_ExistsChannelX function in your application to automatically
8676  determine whether this feature is available.
8677 */
8678 
8679 void
8681  DMA_MODULE_ID index ,
8682  DMA_CHANNEL channel ) ;
8683 //******************************************************************************
8684 /* Function:
8685  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
8686  DMA_CHANNEL channel )
8687  Summary:
8688  Chains the specified channel to a channel lower in natural priority.
8689  Description:
8690  This function will chain the specified channel to a channel lower in
8691  natural priority. CH3 will be enabled by a CH4 transfer complete.
8692  Precondition:
8693  None.
8694  Parameters:
8695  channel - One of the possible DMA channels listed by DMA_CHANNEL
8696  Returns:
8697  None.
8698  Example:
8699  <code>
8700  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
8701  </code>
8702  Remarks:
8703  This function implements an operation of the ChannelXChain feature.
8704  This feature may not be available on all devices. Please refer to the
8705  specific device data sheet to determine availability or use the
8706  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8707  determine whether this feature is available.
8708 */
8709 
8710 void
8712  DMA_MODULE_ID index ,
8713  DMA_CHANNEL channel ) ;
8714 //******************************************************************************
8715 /* Function:
8716  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
8717  DMA_CHANNEL channel )
8718  Summary:
8719  Chains the specified channel to a channel higher in natural priority.
8720  Description:
8721  This function will chain the specified channel to a channel higher in
8722  natural priority. CH5 will be enabled by a CH4 transfer complete.
8723  Precondition:
8724  None.
8725  Parameters:
8726  channel - One of the possible DMA channels listed by DMA_CHANNEL
8727  Returns:
8728  None.
8729  Example:
8730  <code>
8731  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
8732  </code>
8733  Remarks:
8734  This function implements an operation of the ChannelXChain feature.
8735  This feature may not be available on all devices. Please refer to the
8736  specific device data sheet to determine availability or use the
8737  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8738  determine whether this feature is available.
8739 */
8740 
8741 void
8743  DMA_MODULE_ID index ,
8744  DMA_CHANNEL channel ) ;
8745 //******************************************************************************
8746 /* Function:
8747  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
8748  DMA_CHANNEL channel )
8749  Summary:
8750  Sets the Busy bit to active.
8751  Description:
8752  This function sets the Busy bit to active, indicating the channel is active
8753  or has been enabled.
8754  Precondition:
8755  None.
8756  Parameters:
8757  channel - One of the possible DMA channels listed by DMA_CHANNEL
8758  Returns:
8759  None.
8760  Example:
8761  <code>
8762  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8763  </code>
8764  Remarks:
8765  This function implements an operation of the ChannelXBusy feature.
8766  This feature may not be available on all devices. Please refer to the
8767  specific device data sheet to determine availability or use the
8768  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8769  determine whether this feature is available.
8770 */
8771 
8772 void
8774  DMA_MODULE_ID index ,
8775  DMA_CHANNEL channel ) ;
8776 //******************************************************************************
8777 /* Function:
8778  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
8779  DMA_CHANNEL channel )
8780  Summary:
8781  Sets the Busy bit to inactive.
8782  Description:
8783  This function sets the Busy bit to inactive, indicating the channel is inactive
8784  or has been disabled.
8785  Precondition:
8786  None.
8787  Parameters:
8788  channel - One of the possible DMA channels listed by DMA_CHANNEL
8789  Returns:
8790  None.
8791  Example:
8792  <code>
8793  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8794  </code>
8795  Remarks:
8796  This function implements an operation of the ChannelXBusy feature.
8797  This feature may not be available on all devices. Please refer to the
8798  specific device data sheet to determine availability or use the
8799  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8800  determine whether this feature is available.
8801 */
8802 
8803 void
8805  DMA_MODULE_ID index ,
8806  DMA_CHANNEL channel ) ;
8807 //******************************************************************************
8808 /* Function:
8809  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
8810  DMA_CHANNEL channel )
8811  Summary:
8812  Returns the busy status of the specified channel.
8813  Description:
8814  This function returns the busy status of the specified channel.
8815  Precondition:
8816  None.
8817  Parameters:
8818  channel - One of the possible DMA channels listed by DMA_CHANNEL
8819  Returns:
8820  - true - The channel is active or has been enabled
8821  - false - The channel is inactive or has been disabled
8822  Example:
8823  <code>
8824  bool chBusyStatus;
8825  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
8826  </code>
8827  Remarks:
8828  This function implements an operation of the ChannelXBusy feature.
8829  This feature may not be available on all devices. Please refer to the
8830  specific device data sheet to determine availability or use the
8831  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8832  determine whether this feature is available.
8833 */
8834 
8835 bool
8837  DMA_MODULE_ID index ,
8838  DMA_CHANNEL channel ) ;
8839 //******************************************************************************
8840 /* Function:
8841  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
8842  DMA_CHANNEL channel,
8843  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
8844  Summary:
8845  Selects the data transfer direction of the specified channel.
8846  Description:
8847  This function selects the data transfer direction of the specified channel.
8848  Precondition:
8849  None.
8850  Parameters:
8851  channel - One of the possible DMA channels listed by DMA_CHANNEL
8852  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
8853  Returns:
8854  None.
8855  Example:
8856  <code>
8857  PLIB_DMA_ChannelXTransferDirectionSelect (
8858  DMA_ID_0,
8859  DMA_CHANNEL_4,
8860  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
8861  </code>
8862  Remarks:
8863  This feature is not available on all devices. Please refer to the specific
8864  device data sheet to determine availability.
8865 */
8866 
8867 void
8869  DMA_MODULE_ID index ,
8870  DMA_CHANNEL channel ,
8871  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
8872 //******************************************************************************
8873 /* Function:
8874  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
8875  DMA_MODULE_ID index,
8876  DMA_CHANNEL channel)
8877  Summary:
8878  Returns the data transfer direction of the specified channel.
8879  Description:
8880  This function returns the data transfer direction of the specified channel.
8881  Precondition:
8882  None.
8883  Parameters:
8884  channel - One of the possible DMA channels listed by DMA_CHANNEL
8885  Returns:
8886  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
8887  DMA_CHANNEL_TRANSFER_DIRECTION
8888  Example:
8889  <code>
8890  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
8891  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
8892  DMA_ID_0,
8893  DMA_CHANNEL_4 );
8894  </code>
8895  Remarks:
8896  This feature is not available on all devices. Please refer to the specific
8897  device data sheet to determine availability.
8898 */
8899 
8900 DMA_CHANNEL_TRANSFER_DIRECTION
8902  DMA_MODULE_ID index ,
8903  DMA_CHANNEL channel ) ;
8904 //******************************************************************************
8905 /* Function:
8906  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
8907  DMA_CHANNEL channel ,
8908  uint16_t address,
8909  DMA_ADDRESS_OFFSET_TYPE offset )
8910  Summary:
8911  Sets the primary/secondary start address (DPSRAM) offset to the value
8912  specified depending on the offset type specified for the specified channel.
8913  Description:
8914  This function sets the primary/secondary start address (DPSRAM) offset to the value
8915  specified depending on the offset type specified for the specified channel.
8916  Precondition:
8917  None.
8918  Parameters:
8919  channel - One of the possible DMA channels listed by DMA_CHANNEL
8920  address - The primary/secondary DPSRAM start address offset
8921  offset - The type of the address offset (primary/secondary)
8922  Returns:
8923  None.
8924  Example:
8925  <code>
8926  uint16_t address = 0x100;
8927  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
8928  DMA_CHANNEL_4,
8929  address,
8930  DMA_ADDRESS_OFFSET_PRIMARY );
8931  </code>
8932  Remarks:
8933  This feature is not available on all devices. Please refer to the specific
8934  device data sheet to determine availability.
8935 */
8936 
8937 void
8939  DMA_MODULE_ID index ,
8940  DMA_CHANNEL channel ,
8941  uint16_t address ,
8942  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8943 //******************************************************************************
8944 /* Function:
8945  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
8946  DMA_CHANNEL channel,
8947  DMA_ADDRESS_OFFSET_TYPE offset)
8948  Summary:
8949  Gets the primary/secondary start address (DPSRAM) offset.
8950  Description:
8951  This function gets the primary/secondary start address (DPSRAM) offset.
8952  Precondition:
8953  None.
8954  Parameters:
8955  channel - One of the possible DMA channels listed by DMA_CHANNEL
8956  offset - The type of the address offset (primary/secondary)
8957  Returns:
8958  - uint16_t - The primary/secondary DPSRAM start address offset
8959  Example:
8960  <code>
8961  uint16_t addressOffsetA;
8962  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
8963  DMA_ID_0,
8964  DMA_CHANNEL_4,
8965  address,
8966  DMA_ADDRESS_OFFSET_PRIMARY );
8967  </code>
8968  Remarks:
8969  This feature is not available on all devices. Please refer to the specific
8970  device data sheet to determine availability.
8971 */
8972 
8973 uint16_t
8975  DMA_MODULE_ID index ,
8976  DMA_CHANNEL channel ,
8977  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8978 //******************************************************************************
8979 /* Function:
8980  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
8981  DMA_CHANNEL channel ,
8982  uint16_t peripheraladdress )
8983  Summary:
8984  Sets the peripheral address for the specified channel.
8985  Description:
8986  This function sets the peripheral address for the specified channel.
8987  Precondition:
8988  None.
8989  Parameters:
8990  channel - One of the possible DMA channels listed by DMA_CHANNEL
8991  peripheraladdress - The peripheral address for the specified channel
8992  Returns:
8993  None.
8994  Example:
8995  <code>
8996  uint16_t peripheraladdress = 0x100;
8997  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
8998  DMA_CHANNEL_4,
8999  peripheraladdress );
9000  </code>
9001  Remarks:
9002  This feature is not available on all devices. Please refer to the specific
9003  device data sheet to determine availability.
9004 */
9005 
9006 void
9008  DMA_MODULE_ID index ,
9009  DMA_CHANNEL channel ,
9010  uint16_t peripheraladdress ) ;
9011 //******************************************************************************
9012 /* Function:
9013  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9014  DMA_CHANNEL channel )
9015  Summary:
9016  Gets the peripheral address configured for the specified channel.
9017  Description:
9018  This function gets the peripheral address configured for the specified channel.
9019  Precondition:
9020  None.
9021  Parameters:
9022  channel - One of the possible DMA channels listed by DMA_CHANNEL
9023  Returns:
9024  - uint16_t - The peripheral address configured for the specified channel
9025  Example:
9026  <code>
9027  uint16_t peripheraladdress;
9028  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9029  DMA_CHANNEL_4 );
9030  </code>
9031  Remarks:
9032  This feature is not available on all devices. Please refer to the specific
9033  device data sheet to determine availability.
9034 */
9035 
9036 uint16_t
9038  DMA_MODULE_ID index ,
9039  DMA_CHANNEL channel ) ;
9040 //******************************************************************************
9041 /* Function:
9042  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9043  DMA_CHANNEL channel ,
9044  uint16_t transferCount )
9045  Summary:
9046  Sets the DMA data transfer count for the specified channel.
9047  Description:
9048  This function sets the DMA data transfer count for the specified channel.
9049  Precondition:
9050  None.
9051  Parameters:
9052  channel - One of the possible DMA channels listed by DMA_CHANNEL
9053  transferCount - The DMA transfer count for the channel
9054  Returns:
9055  None.
9056  Example:
9057  <code>
9058  uint16_t transferCount = 0x10;
9059  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9060  DMA_CHANNEL_4,
9061  transferCount );
9062  </code>
9063  Remarks:
9064  This feature is not available on all devices. Please refer to the specific
9065  device data sheet to determine availability.
9066 */
9067 
9068 void
9070  DMA_MODULE_ID index ,
9071  DMA_CHANNEL channel ,
9072  uint16_t transferCount ) ;
9073 //******************************************************************************
9074 /* Function:
9075  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9076  DMA_CHANNEL channel )
9077  Summary:
9078  Gets the DMA data transfer count that is programmed for the specified channel.
9079  Description:
9080  This function gets the DMA data transfer count that is programmed for the specified channel.
9081  Precondition:
9082  None.
9083  Parameters:
9084  channel - One of the possible DMA channels listed by DMA_CHANNEL
9085  Returns:
9086  - uint16_t - The DMA transfer count for the channel
9087  Example:
9088  <code>
9089  uint16_t transferCount;
9090  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9091  DMA_CHANNEL_4 );
9092  </code>
9093  Remarks:
9094  This feature is not available on all devices. Please refer to the specific
9095  device data sheet to determine availability.
9096 */
9097 
9098 uint16_t
9100  DMA_MODULE_ID index ,
9101  DMA_CHANNEL channel ) ;
9102 //******************************************************************************
9103 /* Function:
9104  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9105  DMA_MODULE_ID index,
9106  DMA_CHANNEL channel,
9107  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9108  Summary:
9109  Sets the source address mode of the specified channel.
9110  Description:
9111  This function sets the source address mode of the specified channel.
9112  Precondition:
9113  None.
9114  Parameters:
9115  channel - One of the possible DMA channels listed by DMA_CHANNEL
9116  sourceAddressMode - One of the possible source addressing modes listed by
9117  DMA_SOURCE_ADDRESSING_MODE
9118  Returns:
9119  None.
9120  Example:
9121  <code>
9122  PLIB_DMA_ChannelXSourceAddressModeSelect (
9123  DMA_ID_0,
9124  DMA_CHANNEL_4,
9125  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9126  </code>
9127  Remarks:
9128  This feature is not available on all devices. Please refer to the specific
9129  device data sheet to determine availability.
9130 */
9131 
9132 void
9134  DMA_MODULE_ID index ,
9135  DMA_CHANNEL channel ,
9136  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9137 //******************************************************************************
9138 /* Function:
9139  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9140  DMA_MODULE_ID index,
9141  DMA_CHANNEL channel )
9142  Summary:
9143  Gets the source address mode of the specified channel.
9144  Description:
9145  This function gets the source address mode of the specified channel.
9146  Precondition:
9147  None.
9148  Parameters:
9149  channel - One of the possible DMA channels listed by DMA_CHANNEL
9150  Returns:
9151  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9152  listed by DMA_SOURCE_ADDRESSING_MODE
9153  Example:
9154  <code>
9155  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9156  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9157  DMA_CHANNEL_4 );
9158  </code>
9159  Remarks:
9160  This feature is not available on all devices. Please refer to the specific
9161  device data sheet to determine availability.
9162 */
9163 
9164 DMA_SOURCE_ADDRESSING_MODE
9166  DMA_MODULE_ID index ,
9167  DMA_CHANNEL channel ) ;
9168 //******************************************************************************
9169 /* Function:
9170  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9171  DMA_MODULE_ID index,
9172  DMA_CHANNEL channel,
9173  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9174  Summary:
9175  Sets the source address mode of the specified channel.
9176  Description:
9177  This function Sets the source address mode of the specified channel.
9178  Precondition:
9179  None.
9180  Parameters:
9181  channel - One of the possible DMA channels listed by DMA_CHANNEL
9182  destinationAddressMode - One of the possible source addressing modes listed by
9183  DMA_DESTINATION_ADDRESSING_MODE
9184  Returns:
9185  None.
9186  Example:
9187  <code>
9188  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9189  DMA_ID_0,
9190  DMA_CHANNEL_4,
9191  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9192  </code>
9193  Remarks:
9194  This feature is not available on all devices. Please refer to the specific
9195  device data sheet to determine availability.
9196 */
9197 
9198 void
9200  DMA_MODULE_ID index ,
9201  DMA_CHANNEL channel ,
9202  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9203 //******************************************************************************
9204 /* Function:
9205  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9206  DMA_MODULE_ID index,
9207  DMA_CHANNEL channel )
9208  Summary:
9209  Gets the source address mode of the specified channel.
9210  Description:
9211  This function gets the source address mode of the specified channel.
9212  Precondition:
9213  None.
9214  Parameters:
9215  channel - One of the possible DMA channels listed by DMA_CHANNEL
9216  Returns:
9217  - destinationAddressMode - One of the possible source addressing modes listed by
9218  DMA_DESTINATION_ADDRESSING_MODE
9219  Example:
9220  <code>
9221  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9222  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9223  DMA_ID_0,
9224  DMA_CHANNEL_4 );
9225  </code>
9226  Remarks:
9227  This feature is not available on all devices. Please refer to the specific
9228  device data sheet to determine availability.
9229 */
9230 
9231 DMA_DESTINATION_ADDRESSING_MODE
9233  DMA_MODULE_ID index ,
9234  DMA_CHANNEL channel ) ;
9235 //******************************************************************************
9236 /* Function:
9237  void PLIB_DMA_ChannelXAddressModeSelect (
9238  DMA_MODULE_ID index,
9239  DMA_CHANNEL channel,
9240  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9241  Summary:
9242  Sets the channel address mode.
9243  Description:
9244  This function sets the channel address mode.
9245  Precondition:
9246  None.
9247  Parameters:
9248  channel - One of the possible DMA channels listed by DMA_CHANNEL
9249  channelAddressMode - One of the possible channel addressing modes listed by
9250  DMA_CHANNEL_ADDRESSING_MODE
9251  Returns:
9252  None.
9253  Example:
9254  <code>
9255  PLIB_DMA_ChannelXAddressModeSelect (
9256  DMA_ID_0,
9257  DMA_CHANNEL_4,
9258  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9259  </code>
9260  Remarks:
9261  This feature is not available on all devices. Please refer to the specific
9262  device data sheet to determine availability.
9263 */
9264 
9265 void
9267  DMA_MODULE_ID index ,
9268  DMA_CHANNEL channel ,
9269  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9270 //******************************************************************************
9271 /* Function:
9272  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9273  DMA_MODULE_ID index,
9274  DMA_CHANNEL channel )
9275  Summary:
9276  Gets the channel address mode.
9277  Description:
9278  This function gets the channel address mode.
9279  Precondition:
9280  None.
9281  Parameters:
9282  channel - One of the possible DMA channels listed by DMA_CHANNEL
9283  Returns:
9284  - channelAddressMode - One of the possible source addressing modes listed by
9285  DMA_CHANNEL_ADDRESSING_MODE
9286  Example:
9287  <code>
9288  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9289  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9290  DMA_CHANNEL_4 );
9291  </code>
9292  Remarks:
9293  This feature is not available on all devices. Please refer to the specific
9294  device data sheet to determine availability.
9295 */
9296 
9297 DMA_CHANNEL_ADDRESSING_MODE
9299  DMA_MODULE_ID index ,
9300  DMA_CHANNEL channel ) ;
9301 // *****************************************************************************
9302 // *****************************************************************************
9303 // Section: DMA Channel Event Configuration functions
9304 // *****************************************************************************
9305 // *****************************************************************************
9306 //******************************************************************************
9307 /* Function:
9308  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9309  DMA_CHANNEL channel,
9310  DMA_CHANNEL_TRIGGER_TYPE trigger )
9311  Summary:
9312  Enables the specified DMA channel trigger.
9313  Description:
9314  This function enables the specified DMA channel trigger.
9315  Precondition:
9316  None.
9317  Parameters:
9318  channel - One of the possible DMA channels listed by DMA_CHANNEL
9319  trigger - Type of trigger (transfer start/abort/pattern match abort)
9320  Returns:
9321  None.
9322  Example:
9323  <code>
9324  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9325  DMA_CHANNEL_4,
9326  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9327  </code>
9328  Remarks:
9329  This function implements an operation of the ChannelXTrigger feature.
9330  This feature may not be available on all devices. Please refer to the
9331  specific device data sheet to determine availability or use the
9332  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9333  determine whether this feature is available.
9334 */
9335 
9336 void
9338  DMA_MODULE_ID index ,
9339  DMA_CHANNEL channel ,
9340  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9341 //******************************************************************************
9342 /* Function:
9343  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9344  DMA_CHANNEL channel,
9345  DMA_CHANNEL_TRIGGER_TYPE trigger )
9346  Summary:
9347  Returns the enable status of the specified DMA transfer/abort trigger.
9348  Description:
9349  This function returns the enable status of the specified DMA transfer/abort trigger.
9350  Precondition:
9351  None.
9352  Parameters:
9353  channel - One of the possible DMA channels listed by DMA_CHANNEL
9354  trigger - Type of trigger (transfer start/abort/pattern match abort)
9355  Returns:
9356  - true - The specified trigger is enabled
9357  - false - The specified trigger is disabled
9358  Example:
9359  <code>
9360  bool startTriggerstatus;
9361  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9362  DMA_ID_0,
9363  DMA_CHANNEL_4,
9364  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9365  </code>
9366  Remarks:
9367  This function implements an operation of the ChannelXTrigger feature.
9368  This feature may not be available on all devices. Please refer to the
9369  specific device data sheet to determine availability or use the
9370  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9371  determine whether this feature is available.
9372 */
9373 
9374 bool
9376  DMA_MODULE_ID index ,
9377  DMA_CHANNEL channel ,
9378  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9379 //******************************************************************************
9380 /* Function:
9381  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9382  DMA_CHANNEL channel,
9383  DMA_CHANNEL_TRIGGER_TYPE trigger )
9384  Summary:
9385  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9386  Description:
9387  This function disables the DMA transfer abort via a matching interrupt
9388  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9389  a transfer.
9390  Precondition:
9391  None.
9392  Parameters:
9393  channel - One of the possible DMA channels listed by DMA_CHANNEL
9394  trigger - Type of trigger (transfer start/abort/pattern match abort)
9395  Returns:
9396  None.
9397  Example:
9398  <code>
9399  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9400  DMA_CHANNEL_4,
9401  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9402  </code>
9403  Remarks:
9404  This function implements an operation of the ChannelXTrigger feature.
9405  This feature may not be available on all devices. Please refer to the
9406  specific device data sheet to determine availability or use the
9407  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9408  determine whether this feature is available.
9409 */
9410 
9411 void
9413  DMA_MODULE_ID index ,
9414  DMA_CHANNEL channel ,
9415  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9416 //******************************************************************************
9417 /* Function:
9418  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9419  DMA_CHANNEL channel)
9420  Summary:
9421  Gets the source number for the DMA channel interrupts.
9422  Description:
9423  This function returns the interrupt source number for the specified
9424  DMA channel.
9425  Precondition:
9426  None.
9427  Parameters:
9428  channel - One of the possible DMA channels listed by DMA_CHANNEL
9429  Returns:
9430  None.
9431  Example:
9432  <code>
9433  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9434  DMA_CHANNEL_4);
9435  </code>
9436  Remarks:
9437  This function implements an operation of the ChannelXTrigger feature.
9438  This feature may not be available on all devices. Please refer to the
9439  specific device data sheet to determine availability or use the
9440  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9441  determine whether this feature is available.
9442 */
9443 
9444 DMA_CHANNEL_INT_SOURCE
9446  DMA_MODULE_ID index ,
9447  DMA_CHANNEL channel ) ;
9448 //******************************************************************************
9449 /* Function:
9450  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9451  DMA_CHANNEL channel,
9452  DMA_TRIGGER_SOURCE IRQnum )
9453  Summary:
9454  Sets the IRQ to initiate the DMA transfer on the specified channel.
9455  Description:
9456  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9457  (IRQ to start the channel transfer.)
9458  Precondition:
9459  None.
9460  Parameters:
9461  channel - One of the possible DMA channels listed by DMA_CHANNEL
9462  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9463  Returns:
9464  None.
9465  Example:
9466  <code>
9467  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9468  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9469  DMA_CHANNEL_4,
9470  irq );
9471  </code>
9472  Remarks:
9473  This function implements an operation of the ChannelXStartIRQ feature.
9474  This feature may not be available on all devices. Please refer to the
9475  specific device data sheet to determine availability or use the
9476  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9477  determine whether this feature is available.
9478 */
9479 
9480 void
9482  DMA_MODULE_ID index ,
9483  DMA_CHANNEL channel ,
9484  DMA_TRIGGER_SOURCE IRQnum ) ;
9485 //******************************************************************************
9486 /* Function:
9487  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9488  DMA_CHANNEL channel,
9489  DMA_TRIGGER_SOURCE IRQ )
9490  Summary:
9491  Sets the IRQ to abort the DMA transfer on the specified channel.
9492  Description:
9493  This function sets the IRQ to abort the DMA transfer on the specified channel.
9494  (IRQ to start the channel transfer.)
9495  Precondition:
9496  None.
9497  Parameters:
9498  channel - One of the possible DMA channels listed by DMA_CHANNEL
9499  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9500  Returns:
9501  None.
9502  Example:
9503  <code>
9504  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9505  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9506  DMA_CHANNEL_4,
9507  irq );
9508  </code>
9509  Remarks:
9510  This function implements an operation of the ChannelXAbortIRQ feature.
9511  This feature may not be available on all devices. Please refer to the
9512  specific device data sheet to determine availability or use the
9513  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9514  determine whether this feature is available.
9515 */
9516 
9517 void
9519  DMA_MODULE_ID index ,
9520  DMA_CHANNEL channel ,
9521  DMA_TRIGGER_SOURCE IRQ ) ;
9522 //******************************************************************************
9523 /* Function:
9524  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9525  DMA_CHANNEL channel,
9526  DMA_CHANNEL_DATA_SIZE channelDataSize )
9527  Summary:
9528  Selects the data size for the specified channel.
9529  Description:
9530  This function selects the data size for the specified channel.
9531  Precondition:
9532  None.
9533  Parameters:
9534  channel - One of the possible DMA channels listed by DMA_CHANNEL
9535  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9536  Returns:
9537  None.
9538  Example:
9539  <code>
9540  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9541  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9542  DMA_CHANNEL_4,
9543  channelDataSize );
9544  </code>
9545  Remarks:
9546  This feature is not available on all devices. Please refer to the specific
9547  device data sheet to determine availability.
9548 */
9549 
9550 void
9552  DMA_MODULE_ID index ,
9553  DMA_CHANNEL channel ,
9554  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
9555 //******************************************************************************
9556 /* Function:
9557  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
9558  DMA_CHANNEL channel )
9559  Summary:
9560  Returns the current data size for the specified channel.
9561  Description:
9562  This function returns the current data size for the specified channel.
9563  Precondition:
9564  None.
9565  Parameters:
9566  channel - One of the possible DMA channels listed by DMA_CHANNEL
9567  Returns:
9568  - channelDataSize - One of the possible data sizes listed by
9569  DMA_CHANNEL_DATA_SIZE
9570  Example:
9571  <code>
9572  DMA_CHANNEL_DATA_SIZE channelDataSize;
9573  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
9574  DMA_CHANNEL_4 );
9575  </code>
9576  Remarks:
9577  This feature is not available on all devices. Please refer to the specific
9578  device data sheet to determine availability.
9579 */
9580 
9581 DMA_CHANNEL_DATA_SIZE
9583  DMA_MODULE_ID index ,
9584  DMA_CHANNEL channel ) ;
9585 //******************************************************************************
9586 /* Function:
9587  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
9588  DMA_MODULE_ID index,
9589  DMA_CHANNEL channel,
9590  DMA_TRANSFER_MODE channeltransferMode )
9591  Summary:
9592  Selects the transfer/operating mode for the specified channel.
9593  Description:
9594  This function selects the transfer/operating mode for the specified channel.
9595  (Transfer mode and operating mode are used interchangeably.)
9596  Precondition:
9597  None.
9598  Parameters:
9599  channel - One of the possible DMA channels listed by DMA_CHANNEL
9600  channeltransferMode - One of the possible operating/transfer modes listed by
9601  DMA_TRANSFER_MODE
9602  Returns:
9603  None.
9604  Example:
9605  <code>
9606  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
9607  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
9608  DMA_CHANNEL_4,
9609  channeltransferMode );
9610  </code>
9611  Remarks:
9612  This feature is not available on all devices. Please refer to the specific
9613  device data sheet to determine availability.
9614 */
9615 
9616 void
9618  DMA_MODULE_ID index ,
9619  DMA_CHANNEL channel ,
9620  DMA_TRANSFER_MODE channeltransferMode ) ;
9621 //******************************************************************************
9622 /* Function:
9623  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
9624  DMA_MODULE_ID index,
9625  DMA_CHANNEL channel )
9626  Summary:
9627  Returns the current transfer/operating mode for the specified channel.
9628  Description:
9629  This function returns the current transfer/operating mode for the specified channel.
9630  (Transfer mode and operating mode are used interchangeably.)
9631  Precondition:
9632  None.
9633  Parameters:
9634  channel - One of the possible DMA channels listed by DMA_CHANNEL
9635  Returns:
9636  - channeltransferMode - One of the possible operating/transfer modes listed
9637  by DMA_TRANSFER_MODE
9638  Example:
9639  <code>
9640  DMA_TRANSFER_MODE channeltransferMode;
9641  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
9642  DMA_ID_0,
9643  DMA_CHANNEL_4 );
9644  </code>
9645  Remarks:
9646  This feature is not available on all devices. Please refer to the specific
9647  device data sheet to determine availability.
9648 */
9649 
9650 DMA_TRANSFER_MODE
9652  DMA_MODULE_ID index ,
9653  DMA_CHANNEL channel ) ;
9654 //******************************************************************************
9655 /* Function:
9656  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
9657  DMA_CHANNEL channel )
9658  Summary:
9659  Enables reloading of the address and count registers.
9660  Description:
9661  This function enables reloading of the address and count registers. The source,
9662  destination address, and the DMA count registers are reloaded to their previous
9663  values upon the start of the next operation.
9664  Precondition:
9665  None.
9666  Parameters:
9667  channel - One of the possible DMA channels listed by DMA_CHANNEL
9668  Returns:
9669  None.
9670  Example:
9671  <code>
9672  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
9673  DMA_CHANNEL_4 );
9674  </code>
9675  Remarks:
9676  This feature is not available on all devices. Please refer to the specific
9677  device data sheet to determine availability.
9678 */
9679 
9680 void
9682  DMA_MODULE_ID index ,
9683  DMA_CHANNEL channel ) ;
9684 //******************************************************************************
9685 /* Function:
9686  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
9687  DMA_CHANNEL channel )
9688  Summary:
9689  Returns the address and count registers reload enable status.
9690  Description:
9691  This function returns the address and count registers reload enable status.
9692  Precondition:
9693  None.
9694  Parameters:
9695  channel - One of the possible DMA channels listed by DMA_CHANNEL
9696  Returns:
9697  - true - The address and count registers reload is enabled
9698  - false - The address and count registers reload is disabled
9699  Example:
9700  <code>
9701  bool chAddressCountReloadStatus;
9702  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
9703  DMA_ID_0,
9704  DMA_CHANNEL_4 );
9705  </code>
9706  Remarks:
9707  This feature is not available on all devices. Please refer to the specific
9708  device data sheet to determine availability.
9709 */
9710 
9711 bool
9713  DMA_MODULE_ID index ,
9714  DMA_CHANNEL channel ) ;
9715 //******************************************************************************
9716 /* Function:
9717  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
9718  DMA_CHANNEL channel )
9719  Summary:
9720  Disables reloading of the address and count registers.
9721  Description:
9722  This function disables reloading of the address and count registers. The source, destination
9723  address, and the DMA count registers are not reloaded to their previous values upon
9724  the start of the next operation.
9725  Precondition:
9726  None.
9727  Parameters:
9728  channel - One of the possible DMA channels listed by DMA_CHANNEL
9729  Returns:
9730  None.
9731  Example:
9732  <code>
9733  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
9734  DMA_CHANNEL_4 );
9735  </code>
9736  Remarks:
9737  This feature is not available on all devices. Please refer to the specific
9738  device data sheet to determine availability.
9739 */
9740 
9741 void
9743  DMA_MODULE_ID index ,
9744  DMA_CHANNEL channel ) ;
9745 //******************************************************************************
9746 /* Function:
9747  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
9748  DMA_CHANNEL channel )
9749  Summary:
9750  Enables the Null Write mode.
9751  Description:
9752  This function enables the Null Write mode. A dummy write is initiated to the
9753  source address for every write to the destination address.
9754  Precondition:
9755  None.
9756  Parameters:
9757  channel - One of the possible DMA channels listed by DMA_CHANNEL
9758  Returns:
9759  None.
9760  Example:
9761  <code>
9762  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
9763  DMA_CHANNEL_4 );
9764  </code>
9765  Remarks:
9766  This feature is not available on all devices. Please refer to the specific
9767  device data sheet to determine availability.
9768 */
9769 
9770 void
9772  DMA_MODULE_ID index ,
9773  DMA_CHANNEL channel ) ;
9774 //******************************************************************************
9775 /* Function:
9776  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
9777  DMA_CHANNEL channel )
9778  Summary:
9779  Returns the enable status of the Null Write mode for the specified channel.
9780  Description:
9781  This function returns the enable status of the Null Write mode for the specified channel.
9782  Precondition:
9783  None.
9784  Parameters:
9785  channel - One of the possible DMA channels listed by DMA_CHANNEL
9786  Returns:
9787  - true - Null write mode is enabled for this channel
9788  - false - Null write mode is disabled for this channel
9789  Example:
9790  <code>
9791  bool chNullWriteStatus;
9792  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
9793  DMA_ID_0,
9794  DMA_CHANNEL_4 );
9795  </code>
9796  Remarks:
9797  This feature is not available on all devices. Please refer to the specific
9798  device data sheet to determine availability.
9799 */
9800 
9801 bool
9803  DMA_MODULE_ID index ,
9804  DMA_CHANNEL channel ) ;
9805 //******************************************************************************
9806 /* Function:
9807  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
9808  DMA_CHANNEL channel )
9809  Summary:
9810  Disables the Null Write mode.
9811  Description:
9812  This function disables the Null Write mode. No dummy write is initiated.
9813  Precondition:
9814  None.
9815  Parameters:
9816  channel - One of the possible DMA channels listed by DMA_CHANNEL
9817  Returns:
9818  None.
9819  Example:
9820  <code>
9821  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
9822  DMA_CHANNEL_4 );
9823  </code>
9824  Remarks:
9825  This feature is not available on all devices. Please refer to the specific
9826  device data sheet to determine availability.
9827 */
9828 
9829 void
9831  DMA_MODULE_ID index ,
9832  DMA_CHANNEL channel ) ;
9833 // *****************************************************************************
9834 // *****************************************************************************
9835 // Section: DMA start/end functions
9836 // *****************************************************************************
9837 // *****************************************************************************
9838 //******************************************************************************
9839 /* Function:
9840  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
9841  DMA_CHANNEL channel )
9842  Summary:
9843  Initiates transfer on the specified channel.
9844  Description:
9845  This function initiates transfer on the specified channel. This is a forced transfer
9846  controlled via software.
9847  Precondition:
9848  None.
9849  Parameters:
9850  channel - One of the possible DMA channels listed by DMA_CHANNEL
9851  Returns:
9852  None.
9853  Example:
9854  <code>
9855  PLIB_DMA_StartTransferSet ( DMA_ID_0,
9856  DMA_CHANNEL_4 );
9857  </code>
9858  Remarks:
9859  This function implements an operation of the StartTransfer feature.
9860  This feature may not be available on all devices. Please refer to the
9861  specific device data sheet to determine availability or use the
9862  PLIB_DMA_ExistsStartTransfer function in your application to automatically
9863  determine whether this feature is available.
9864 */
9865 
9866 void
9868  DMA_MODULE_ID index ,
9869  DMA_CHANNEL channel ) ;
9870 //******************************************************************************
9871 /* Function:
9872  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
9873  DMA_CHANNEL channel )
9874  Summary:
9875  Aborts transfer on the specified channel.
9876  Description:
9877  This function aborts transfer on the specified channel. This is a forced abort
9878  controlled via software.
9879  Precondition:
9880  None.
9881  Parameters:
9882  channel - One of the possible DMA channels listed by DMA_CHANNEL
9883  Returns:
9884  None.
9885  Example:
9886  <code>
9887  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
9888  DMA_CHANNEL_4 );
9889  </code>
9890  Remarks:
9891  This function implements an operation of the AbortTransfer feature.
9892  This feature may not be available on all devices. Please refer to the
9893  specific device data sheet to determine availability or use the
9894  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
9895  determine whether this feature is available.
9896 */
9897 
9898 void
9900  DMA_MODULE_ID index ,
9901  DMA_CHANNEL channel ) ;
9902 // *****************************************************************************
9903 // *****************************************************************************
9904 // Section: DMA General Configuration functions
9905 // *****************************************************************************
9906 // *****************************************************************************
9907 //******************************************************************************
9908 /* Function:
9909  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
9910  Summary:
9911  Sets the BUSY bit of the DMA controller.
9912  Description:
9913  This function sets the BUSY bit of the DMA controller. The DMA module is active.
9914  Precondition:
9915  None.
9916  Parameters:
9917  None.
9918  Returns:
9919  None.
9920  Example:
9921  <code>
9922  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
9923  </code>
9924  Remarks:
9925  This function implements an operation of the Busy feature.
9926  This feature may not be available on all devices. Please refer to the
9927  specific device data sheet to determine availability or use the
9928  PLIB_DMA_ExistsBusy function in your application to automatically
9929  determine whether this feature is available.
9930 */
9931 
9932 void
9934  DMA_MODULE_ID index ) ;
9935 //******************************************************************************
9936 /* Function:
9937  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
9938  Summary:
9939  Resets the BUSY bit of the DMA controller.
9940  Description:
9941  This function resets the BUSY bit of the DMA controller. The DMA module is
9942  disabled and is not actively transferring data.
9943  Precondition:
9944  None.
9945  Parameters:
9946  None.
9947  Returns:
9948  None.
9949  Example:
9950  <code>
9951  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
9952  </code>
9953  Remarks:
9954  This function implements an operation of the Busy feature.
9955  This feature may not be available on all devices. Please refer to the
9956  specific device data sheet to determine availability or use the
9957  PLIB_DMA_ExistsBusy function in your application to automatically
9958  determine whether this feature is available.
9959 */
9960 
9961 void
9963  DMA_MODULE_ID index ) ;
9964 //******************************************************************************
9965 /* Function:
9966  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
9967  Summary:
9968  Gets the BUSY bit of the DMA controller.
9969  Description:
9970  This function gets the BUSY bit of the DMA controller.
9971  Precondition:
9972  None.
9973  Parameters:
9974  None.
9975  Returns:
9976  - true - DMA module is active
9977  - false - DMA module is disabled and is not actively transferring data
9978  Example:
9979  <code>
9980  bool dmaBusyStatus;
9981  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
9982  </code>
9983  Remarks:
9984  This function implements an operation of the Busy feature.
9985  This feature may not be available on all devices. Please refer to the
9986  specific device data sheet to determine availability or use the
9987  PLIB_DMA_ExistsBusy function in your application to automatically
9988  determine whether this feature is available.
9989 */
9990 
9991 bool
9992  PLIB_DMA_IsBusy (
9993  DMA_MODULE_ID index ) ;
9994 //******************************************************************************
9995 /* Function:
9996  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
9997  Summary:
9998  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
9999  Description:
10000  This function suspends the DMA transfers to allow uninterrupted access
10001  by the CPU to the data bus.
10002  Precondition:
10003  None.
10004  Parameters:
10005  None.
10006  Returns:
10007  None.
10008  Example:
10009  <code>
10010  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10011  </code>
10012  Remarks:
10013  This function implements an operation of the Suspend feature.
10014  This feature may not be available on all devices. Please refer to the
10015  specific device data sheet to determine availability or use the
10016  PLIB_DMA_ExistsSuspend function in your application to automatically
10017  determine whether this feature is available.
10018 */
10019 
10020 void
10022  DMA_MODULE_ID index ) ;
10023 //******************************************************************************
10024 /* Function:
10025  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10026  Summary:
10027  DMA suspend is disabled and the DMA module operates normally.
10028  Description:
10029  This function disables the DMA suspend. The DMA module continues to operate
10030  normally.
10031  Precondition:
10032  None.
10033  Parameters:
10034  None.
10035  Returns:
10036  None.
10037  Example:
10038  <code>
10039  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10040  </code>
10041  Remarks:
10042  This function implements an operation of the Suspend feature.
10043  This feature may not be available on all devices. Please refer to the
10044  specific device data sheet to determine availability or use the
10045  PLIB_DMA_ExistsSuspend function in your application to automatically
10046  determine whether this feature is available.
10047 */
10048 
10049 void
10051  DMA_MODULE_ID index ) ;
10052 //******************************************************************************
10053 /* Function:
10054  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10055  Summary:
10056  Returns the DMA suspend status.
10057  Description:
10058  This function returns the DMA suspend status.
10059  Precondition:
10060  None.
10061  Parameters:
10062  None.
10063  Returns:
10064  - true - The DMA transfers are suspended
10065  - false - The DMA operates normally
10066  Example:
10067  <code>
10068  bool dmaSuspendStatus;
10069  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10070  </code>
10071  Remarks:
10072  This function implements an operation of the Suspend feature.
10073  This feature may not be available on all devices. Please refer to the
10074  specific device data sheet to determine availability or use the
10075  PLIB_DMA_ExistsSuspend function in your application to automatically
10076  determine whether this feature is available.
10077 */
10078 
10079 bool
10081  DMA_MODULE_ID index ) ;
10082 //******************************************************************************
10083 /* Function:
10084  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10085  Summary:
10086  DMA transfers are halted during Idle mode.
10087  Description:
10088  This function halts DMA transfers during Idle mode.
10089  Precondition:
10090  None.
10091  Parameters:
10092  None.
10093  Returns:
10094  None.
10095  Example:
10096  <code>
10097  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10098  </code>
10099  Remarks:
10100  This function implements an operation of the StopInIdle feature.
10101  This feature may not be available on all devices. Please refer to the
10102  specific device data sheet to determine availability or use the
10103  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10104  determine whether this feature is available.
10105 */
10106 
10107 void
10109  DMA_MODULE_ID index ) ;
10110 //******************************************************************************
10111 /* Function:
10112  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10113  Summary:
10114  DMA transfers continue during Idle mode.
10115  Description:
10116  This function causes DMA transfers to continue during Idle mode.
10117  Precondition:
10118  None.
10119  Parameters:
10120  None.
10121  Returns:
10122  None.
10123  Example:
10124  <code>
10125  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10126  </code>
10127  Remarks:
10128  This function implements an operation of the StopInIdle feature.
10129  This feature may not be available on all devices. Please refer to the
10130  specific device data sheet to determine availability or use the
10131  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10132  determine whether this feature is available.
10133 */
10134 
10135 void
10137  DMA_MODULE_ID index ) ;
10138 //******************************************************************************
10139 /* Function:
10140  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10141  Summary:
10142  DMA module is enabled.
10143  Description:
10144  This function enables the DMA module.
10145  Precondition:
10146  None.
10147  Parameters:
10148  None.
10149  Returns:
10150  None.
10151  Example:
10152  <code>
10153  PLIB_DMA_Enable( DMA_ID_0 );
10154  </code>
10155  Remarks:
10156  This function implements an operation of the EnableControl feature.
10157  This feature may not be available on all devices. Please refer to the
10158  specific device data sheet to determine availability or use the
10159  PLIB_DMA_ExistsEnableControl function in your application to automatically
10160  determine whether this feature is available.
10161 */
10162 
10163 void
10164  PLIB_DMA_Enable (
10165  DMA_MODULE_ID index ) ;
10166 //******************************************************************************
10167 /* Function:
10168  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10169  Summary:
10170  Returns the DMA module enable status.
10171  Description:
10172  This function returns the DMA module enable status.
10173  Precondition:
10174  None.
10175  Parameters:
10176  None.
10177  Returns:
10178  - true - The DMA is enabled
10179  - false - The DMA is disabled
10180  Example:
10181  <code>
10182  PLIB_DMA_IsEnabled( DMA_ID_0 );
10183  </code>
10184  Remarks:
10185  This function implements an operation of the EnableControl feature.
10186  This feature may not be available on all devices. Please refer to the
10187  specific device data sheet to determine availability or use the
10188  PLIB_DMA_ExistsEnableControl function in your application to automatically
10189  determine whether this feature is available.
10190 */
10191 
10192 bool
10194  DMA_MODULE_ID index ) ;
10195 //******************************************************************************
10196 /* Function:
10197  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10198  Summary:
10199  DMA module is disabled.
10200  Description:
10201  This function disables the DMA module.
10202  Precondition:
10203  None.
10204  Parameters:
10205  None.
10206  Returns:
10207  None.
10208  Example:
10209  <code>
10210  PLIB_DMA_Disable( DMA_ID_0 );
10211  </code>
10212  Remarks:
10213  This function implements an operation of the EnableControl feature.
10214  This feature may not be available on all devices. Please refer to the
10215  specific device data sheet to determine availability or use the
10216  PLIB_DMA_ExistsEnableControl function in your application to automatically
10217  determine whether this feature is available.
10218 */
10219 
10220 void
10222  DMA_MODULE_ID index ) ;
10223 // *****************************************************************************
10224 // *****************************************************************************
10225 // Section: DMA status functions
10226 // *****************************************************************************
10227 // *****************************************************************************
10228 //******************************************************************************
10229 /* Function:
10230  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10231  Summary:
10232  Returns the DMA channel bits.
10233  Description:
10234  This function returns the channel bits.
10235  Precondition:
10236  None.
10237  Parameters:
10238  None.
10239  Returns:
10240  - uint8_t - DMA channel bits
10241  Example:
10242  <code>
10243  uint8_t dmaChBits;
10244  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10245  </code>
10246  Remarks:
10247  This function implements an operation of the ChannelBits feature.
10248  This feature may not be available on all devices. Please refer to the
10249  specific device data sheet to determine availability or use the
10250  PLIB_DMA_ExistsChannelBits function in your application to automatically
10251  determine whether this feature is available.
10252 */
10253 
10254 uint8_t
10256  DMA_MODULE_ID index ) ;
10257 //******************************************************************************
10258 /* Function:
10259  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10260  Summary:
10261  Returns true if the last DMA bus access was a read.
10262  Description:
10263  This function returns true if the last DMA bus access was a read.
10264  Precondition:
10265  None.
10266  Parameters:
10267  None.
10268  Returns:
10269  - true - The last bus access was a read
10270  - false - The last bus access was not a read
10271  Example:
10272  <code>
10273  bool dmaLastBusAccessType;
10274  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10275  </code>
10276  Remarks:
10277  This function implements an operation of the LastBusAccess feature.
10278  This feature may not be available on all devices. Please refer to the
10279  specific device data sheet to determine availability or use the
10280  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10281  determine whether this feature is available.
10282 */
10283 
10284 bool
10286  DMA_MODULE_ID index ) ;
10287 //******************************************************************************
10288 /* Function:
10289  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10290  Summary:
10291  Returns true if the last DMA bus access was a write.
10292  Description:
10293  This function returns true if the last DMA bus access was a write operation.
10294  Precondition:
10295  None.
10296  Parameters:
10297  None.
10298  Returns:
10299  - true - The last bus access was a write operation
10300  - false - The last bus access was not a write operation
10301  Example:
10302  <code>
10303  bool dmaLastBusAccessType;
10304  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10305  </code>
10306  Remarks:
10307  This function implements an operation of the LastBusAccess feature.
10308  This feature may not be available on all devices. Please refer to the
10309  specific device data sheet to determine availability or use the
10310  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10311  determine whether this feature is available.
10312 */
10313 
10314 bool
10316  DMA_MODULE_ID index ) ;
10317 //******************************************************************************
10318 /* Function:
10319  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10320  Summary:
10321  Returns the address of the most recent DMA access.
10322  Description:
10323  This function returns the address of the most recent DMA access.
10324  Precondition:
10325  None.
10326  Parameters:
10327  None.
10328  Returns:
10329  - uint32_t - The most recent address accessed by the DMA
10330  Example:
10331  <code>
10332  uint32_t dmaLastAddressAccessed;
10333  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10334  </code>
10335  Remarks:
10336  This function implements an operation of the RecentAddress feature.
10337  This feature may not be available on all devices. Please refer to the
10338  specific device data sheet to determine availability or use the
10339  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10340  determine whether this feature is available.
10341 */
10342 
10343 uint32_t
10345  DMA_MODULE_ID index ) ;
10346 // *****************************************************************************
10347 // *****************************************************************************
10348 // Section: DMA Module CRC Feature Interface Functions
10349 // *****************************************************************************
10350 // *****************************************************************************
10351 //******************************************************************************
10352 /* Function:
10353  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10354  DMA_CHANNEL channel )
10355  Summary:
10356  Assigns the CRC to the specified DMA channel.
10357  Description:
10358  This function assigns the CRC feature to the specified channel.
10359  Precondition:
10360  None.
10361  Parameters:
10362  channel - One of the possible DMA channels listed by DMA_CHANNEL
10363  Returns:
10364  None.
10365  Example:
10366  <code>
10367  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10368  DMA_CHANNEL_5 );
10369  </code>
10370  Remarks:
10371  This function implements an operation of the CRCChannel feature.
10372  This feature may not be available on all devices. Please refer to the
10373  specific device data sheet to determine availability or use the
10374  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10375  determine whether this feature is available.
10376 */
10377 
10378 void
10380  DMA_MODULE_ID index ,
10381  DMA_CHANNEL channel ) ;
10382 //******************************************************************************
10383 /* Function:
10384  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10385  Summary:
10386  Returns the current DMA channel to which the CRC is assigned.
10387  Description:
10388  This function returns the current DMA channel to which the CRC is assigned.
10389  Precondition:
10390  None.
10391  Parameters:
10392  None.
10393  Returns:
10394  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10395  Example:
10396  <code>
10397  DMA_CHANNEL crcChannel;
10398  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10399  </code>
10400  Remarks:
10401  This function implements an operation of the CRCChannel feature.
10402  This feature may not be available on all devices. Please refer to the
10403  specific device data sheet to determine availability or use the
10404  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10405  determine whether this feature is available.
10406 */
10407 
10408 DMA_CHANNEL
10410  DMA_MODULE_ID index ) ;
10411 //******************************************************************************
10412 /* Function:
10413  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10414  DMA_CRC_TYPE CRCType )
10415  Summary:
10416  Selects the DMA module CRC feature type.
10417  Description:
10418  This function selects the DMA module CRC feature type. The CRC feature will
10419  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10420  checksum.
10421  Precondition:
10422  None.
10423  Parameters:
10424  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10425  Returns:
10426  None.
10427  Example:
10428  <code>
10429  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10430  DMA_CRC_IP_HEADER );
10431  </code>
10432  Remarks:
10433  This function implements an operation of the CRCType feature.
10434  This feature may not be available on all devices. Please refer to the
10435  specific device data sheet to determine availability or use the
10436  PLIB_DMA_ExistsCRCType function in your application to automatically
10437  determine whether this feature is available.
10438 */
10439 
10440 void
10442  DMA_MODULE_ID index ,
10443  DMA_CRC_TYPE CRCType ) ;
10444 //******************************************************************************
10445 /* Function:
10446  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10447  Summary:
10448  Gets the current DMA module CRC feature type.
10449  Description:
10450  This function gets the DMA module CRC feature type. The CRC feature will
10451  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10452  checksum.
10453  Precondition:
10454  None.
10455  Parameters:
10456  None.
10457  Returns:
10458  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10459  Example:
10460  <code>
10461  DMA_CRC_TYPE CRCType;
10462  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10463  </code>
10464  Remarks:
10465  This function implements an operation of the CRCType feature.
10466  This feature may not be available on all devices. Please refer to the
10467  specific device data sheet to determine availability or use the
10468  PLIB_DMA_ExistsCRCType function in your application to automatically
10469  determine whether this feature is available.
10470 */
10471 
10472 DMA_CRC_TYPE
10474  DMA_MODULE_ID index ) ;
10475 //******************************************************************************
10476 /* Function:
10477  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10478  Summary:
10479  Enables the CRC append mode.
10480  Description:
10481  This function enables the CRC append mode. The DMA transfers data from the source
10482  into the CRC, but not to the destination. When a block transfer completes, the
10483  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10484  Precondition:
10485  None.
10486  Parameters:
10487  None.
10488  Returns:
10489  None.
10490  Example:
10491  <code>
10492  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10493  </code>
10494  Remarks:
10495  This function implements an operation of the CRCAppendMode feature.
10496  This feature may not be available on all devices. Please refer to the
10497  specific device data sheet to determine availability or use the
10498  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10499  determine whether this feature is available.
10500 */
10501 
10502 void
10504  DMA_MODULE_ID index ) ;
10505 //******************************************************************************
10506 /* Function:
10507  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10508  Summary:
10509  Gets the enable status of the CRC append mode.
10510  Description:
10511  This function gets the enable status of the CRC append mode.
10512  Precondition:
10513  None.
10514  Parameters:
10515  None.
10516  Returns:
10517  - true - CRC append mode is enabled
10518  - false - CRC append mode is disabled
10519  Example:
10520  <code>
10521  bool DMAcrcAppendMode;
10522  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10523  </code>
10524  Remarks:
10525  This function implements an operation of the CRCAppendMode feature.
10526  This feature may not be available on all devices. Please refer to the
10527  specific device data sheet to determine availability or use the
10528  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10529  determine whether this feature is available.
10530 */
10531 
10532 bool
10534  DMA_MODULE_ID index ) ;
10535 //******************************************************************************
10536 /* Function:
10537  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10538  Summary:
10539  Disables the CRC append mode.
10540  Description:
10541  This function disables the CRC append mode. The DMA transfers data from the
10542  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10543  as it writes the data to the destination.
10544  Precondition:
10545  None.
10546  Parameters:
10547  None.
10548  Returns:
10549  None.
10550  Example:
10551  <code>
10552  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
10553  </code>
10554  Remarks:
10555  This function implements an operation of the CRCAppendMode feature.
10556  This feature may not be available on all devices. Please refer to the
10557  specific device data sheet to determine availability or use the
10558  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10559  determine whether this feature is available.
10560 */
10561 
10562 void
10564  DMA_MODULE_ID index ) ;
10565 //******************************************************************************
10566 /* Function:
10567  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
10568  Summary:
10569  Enables the DMA module CRC feature.
10570  Description:
10571  This function enables the DMA module CRC feature. The channel transfers are
10572  routed through the CRC.
10573  Precondition:
10574  None.
10575  Parameters:
10576  None.
10577  Returns:
10578  None.
10579  Example:
10580  <code>
10581  PLIB_DMA_CRCEnable( DMA_ID_0 );
10582  </code>
10583  Remarks:
10584  This function implements an operation of the CRC feature.
10585  This feature may not be available on all devices. Please refer to the
10586  specific device data sheet to determine availability or use the
10587  PLIB_DMA_ExistsCRC function in your application to automatically
10588  determine whether this feature is available.
10589 */
10590 
10591 void
10593  DMA_MODULE_ID index ) ;
10594 //******************************************************************************
10595 /* Function:
10596  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
10597  Summary:
10598  Gets the enable status of the CRC feature.
10599  Description:
10600  This function gets the enable status of the CRC feature.
10601  Precondition:
10602  None.
10603  Parameters:
10604  None.
10605  Returns:
10606  - true - The CRC feature is enabled
10607  - false - The CRC feature is disabled
10608  Example:
10609  <code>
10610  bool DMAcrcStatus;
10611  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
10612  </code>
10613  Remarks:
10614  This function implements an operation of the CRC feature.
10615  This feature may not be available on all devices. Please refer to the
10616  specific device data sheet to determine availability or use the
10617  PLIB_DMA_ExistsCRC function in your application to automatically
10618  determine whether this feature is available.
10619 */
10620 
10621 bool
10623  DMA_MODULE_ID index ) ;
10624 //******************************************************************************
10625 /* Function:
10626  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
10627  Summary:
10628  Disables the DMA module CRC feature.
10629  Description:
10630  This function disables the DMA module CRC feature. The channel transfers proceed
10631  normally.
10632  Precondition:
10633  None.
10634  Parameters:
10635  None.
10636  Returns:
10637  None.
10638  Example:
10639  <code>
10640  PLIB_DMA_CRCDisable( DMA_ID_0 );
10641  </code>
10642  Remarks:
10643  This function implements an operation of the CRC feature.
10644  This feature may not be available on all devices. Please refer to the
10645  specific device data sheet to determine availability or use the
10646  PLIB_DMA_ExistsCRC function in your application to automatically
10647  determine whether this feature is available.
10648 */
10649 
10650 void
10652  DMA_MODULE_ID index ) ;
10653 //******************************************************************************
10654 /* Function:
10655  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
10656  uint8_t polyLength )
10657  Summary:
10658  Selects the polynomial length.
10659  Description:
10660  This function Selects the polynomial length.
10661  Precondition:
10662  None.
10663  Parameters:
10664  polyLength - Polynomial length
10665  Returns:
10666  None.
10667  Example:
10668  <code>
10669  uint8_t polyLength = 0x2;
10670  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
10671  </code>
10672  Remarks:
10673  This function implements an operation of the CRCPolynomialLength feature.
10674  This feature may not be available on all devices. Please refer to the
10675  specific device data sheet to determine availability or use the
10676  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10677  determine whether this feature is available.
10678 */
10679 
10680 void
10682  DMA_MODULE_ID index ,
10683  uint8_t polyLength ) ;
10684 //******************************************************************************
10685 /* Function:
10686  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
10687  Summary:
10688  Gets the current polynomial length.
10689  Description:
10690  This function gets the current polynomial length.
10691  Precondition:
10692  None.
10693  Parameters:
10694  None.
10695  Returns:
10696  - uint8_t - Polynomial length
10697  Example:
10698  <code>
10699  uint8_t polyLength;
10700  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
10701  </code>
10702  Remarks:
10703  This function implements an operation of the CRCPolynomialLength feature.
10704  This feature may not be available on all devices. Please refer to the
10705  specific device data sheet to determine availability or use the
10706  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10707  determine whether this feature is available.
10708 */
10709 
10710 uint8_t
10712  DMA_MODULE_ID index ) ;
10713 //******************************************************************************
10714 /* Function:
10715  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
10716  DMA_CRC_BIT_ORDER bitOrder )
10717  Summary:
10718  Selects the bit order for checksum calculation.
10719  Description:
10720  This function selects the bit order for checksum calculation.
10721  Precondition:
10722  None.
10723  Parameters:
10724  bitOrder - Specifies the bit order for CRC calculation
10725  Returns:
10726  None.
10727  Example:
10728  <code>
10729  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
10730  </code>
10731  Remarks:
10732  This function implements an operation of the CRCBitOrder feature.
10733  This feature may not be available on all devices. Please refer to the
10734  specific device data sheet to determine availability or use the
10735  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
10736  determine whether this feature is available.
10737 */
10738 
10739 void
10741  DMA_MODULE_ID index ,
10742  DMA_CRC_BIT_ORDER bitOrder ) ;
10743 //******************************************************************************
10744 /* Function:
10745  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
10746  Summary:
10747  The source data is written to the destination reordered as defined by the
10748  BYTO<1:0> bits.
10749  Description:
10750  This function enables byte order alteration as specified by the BYTO<1:0> bits.
10751  The source data is written to the destination reordered as defined by the
10752  BYTO<1:0> bits.
10753  Precondition:
10754  None.
10755  Parameters:
10756  None.
10757  Returns:
10758  None.
10759  Example:
10760  <code>
10761  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
10762  </code>
10763  Remarks:
10764  This function implements an operation of the CRCWriteByteOrder feature.
10765  This feature may not be available on all devices. Please refer to the
10766  specific device data sheet to determine availability or use the
10767  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10768  determine whether this feature is available.
10769 */
10770 
10771 void
10773  DMA_MODULE_ID index ) ;
10774 //******************************************************************************
10775 /* Function:
10776  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
10777  Summary:
10778  The source data is written to the destination unaltered.
10779  Description:
10780  This function disables byte order alteration. The source data is written
10781  to the destination unaltered.
10782  Precondition:
10783  None.
10784  Parameters:
10785  None.
10786  Returns:
10787  None.
10788  Example:
10789  <code>
10790  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
10791  </code>
10792  Remarks:
10793  This function implements an operation of the CRCWriteByteOrder feature.
10794  This feature may not be available on all devices. Please refer to the
10795  specific device data sheet to determine availability or use the
10796  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10797  determine whether this feature is available.
10798 */
10799 
10800 void
10802  DMA_MODULE_ID index ) ;
10803 //******************************************************************************
10804 /* Function:
10805  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
10806  DMA_CRC_BYTE_ORDER byteOrder )
10807  Summary:
10808  Selects the byte order.
10809  Description:
10810  This function selects the byte order.
10811  Precondition:
10812  The WBO bit must be set to use this function.
10813  Parameters:
10814  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10815  Returns:
10816  None.
10817  Example:
10818  <code>
10819  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
10820  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
10821  </code>
10822  Remarks:
10823  This function implements an operation of the CRCByteOrder feature.
10824  This feature may not be available on all devices. Please refer to the
10825  specific device data sheet to determine availability or use the
10826  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10827  determine whether this feature is available.
10828 */
10829 
10830 void
10832  DMA_MODULE_ID index ,
10833  DMA_CRC_BYTE_ORDER byteOrder ) ;
10834 //******************************************************************************
10835 /* Function:
10836  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
10837  Summary:
10838  Gets the current byte order selected by the DMA module CRC feature.
10839  Description:
10840  This function gets the current byte order selected by the DMA module CRC feature.
10841  Precondition:
10842  The WBO bit must be set to use this function.
10843  Parameters:
10844  None.
10845  Returns:
10846  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10847  Example:
10848  <code>
10849  DMA_CRC_BYTE_ORDER byteOrder;
10850  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
10851  </code>
10852  Remarks:
10853  This function implements an operation of the CRCByteOrder feature.
10854  This feature may not be available on all devices. Please refer to the
10855  specific device data sheet to determine availability or use the
10856  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10857  determine whether this feature is available.
10858 */
10859 
10860 DMA_CRC_BYTE_ORDER
10862  DMA_MODULE_ID index ) ;
10863 //******************************************************************************
10864 /* Function:
10865  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
10866  Summary:
10867  Reads the contents of the DMA CRC data register.
10868  Description:
10869  This function reads the contents of the DMA CRC data register.
10870  Precondition:
10871  None.
10872  Parameters:
10873  None.
10874  Returns:
10875  - uint32_t - 32-bit CRC data
10876  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10877  device data sheet to determine availability.
10878  Example:
10879  <code>
10880  uint32_t DMACRCdata;
10881  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
10882  </code>
10883  Remarks:
10884  This function implements an operation of the CRCData feature.
10885  This feature may not be available on all devices. Please refer to the
10886  specific device data sheet to determine availability or use the
10887  PLIB_DMA_ExistsCRCData function in your application to automatically
10888  determine whether this feature is available.
10889 */
10890 
10891 uint32_t
10893  DMA_MODULE_ID index ) ;
10894 //******************************************************************************
10895 /* Function:
10896  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
10897  uint32_t DMACRCdata )
10898  Summary:
10899  Writes the contents of the DMA CRC data register with the specified data.
10900  Description:
10901  This function writes the contents of the DMA CRC data register.
10902  Precondition:
10903  None.
10904  Parameters:
10905  - DMACRCdata - 32-bit CRC data
10906  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10907  device data sheet to determine availability.
10908  Returns:
10909  None.
10910  Example:
10911  <code>
10912  uint32_t DMACRCdata = 0x0E0E0E;
10913  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
10914  </code>
10915  Remarks:
10916  This function implements an operation of the CRCData feature.
10917  This feature may not be available on all devices. Please refer to the
10918  specific device data sheet to determine availability or use the
10919  PLIB_DMA_ExistsCRCData function in your application to automatically
10920  determine whether this feature is available.
10921 */
10922 
10923 void
10925  DMA_MODULE_ID index ,
10926  uint32_t DMACRCdata ) ;
10927 //******************************************************************************
10928 /* Function:
10929  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
10930  Summary:
10931  Reads the CRC XOR register.
10932  Description:
10933  This function reads the CRC XOR register.
10934  Precondition:
10935  None.
10936  Parameters:
10937  None.
10938  Returns:
10939  - uint32_t - 32-bit CRC XOR enable mask data
10940  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10941  device data sheet to determine availability.
10942  Example:
10943  <code>
10944  uint32_t DMACRCXORdata;
10945  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
10946  </code>
10947  Remarks:
10948  This function implements an operation of the CRCXOREnable feature.
10949  This feature may not be available on all devices. Please refer to the
10950  specific device data sheet to determine availability or use the
10951  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10952  determine whether this feature is available.
10953 */
10954 
10955 uint32_t
10957  DMA_MODULE_ID index ) ;
10958 //******************************************************************************
10959 /* Function:
10960  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
10961  uint32_t DMACRCXOREnableMask )
10962  Summary:
10963  Writes to the CRC XOR enable register as per the specified enable mask.
10964  Description:
10965  This function writes to the CRC XOR enable register as per the specified
10966  enable mask. Each enabled bit will be taken as input to the shift register.
10967  Precondition:
10968  None.
10969  Parameters:
10970  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
10971  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10972  device data sheet to determine availability.
10973  Returns:
10974  None.
10975  Example:
10976  <code>
10977  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
10978  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
10979  </code>
10980  Remarks:
10981  This function implements an operation of the CRCXOREnable feature.
10982  This feature may not be available on all devices. Please refer to the
10983  specific device data sheet to determine availability or use the
10984  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10985  determine whether this feature is available.
10986 */
10987 
10988 void
10990  DMA_MODULE_ID index ,
10991  uint32_t DMACRCXOREnableMask ) ;
10992 // *****************************************************************************
10993 // *****************************************************************************
10994 // Section: DMA Address control Interface functions
10995 // *****************************************************************************
10996 // *****************************************************************************
10997 //******************************************************************************
10998 /* Function:
10999  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
11000  DMA_CHANNEL dmaChannel )
11001  Summary:
11002  Reads the source start address configured for the specified channel.
11003  Description:
11004  This function reads the source start address configured for the specified
11005  channel.
11006  Precondition:
11007  None.
11008  Parameters:
11009  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11010  Returns:
11011  - uint32_t - The source start address configured for this channel
11012  Example:
11013  <code>
11014  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11015  uint32_t SourceStartAddress;
11016  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11017  spiDMAChannel );
11018  </code>
11019  Remarks:
11020  This function implements an operation of the ChannelXSourceStartAddress feature.
11021  This feature may not be available on all devices. Please refer to the
11022  specific device data sheet to determine availability or use the
11023  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11024  determine whether this feature is available.
11025 */
11026 
11027 uint32_t
11029  DMA_MODULE_ID index ,
11030  DMA_CHANNEL dmaChannel ) ;
11031 //******************************************************************************
11032 /* Function:
11033  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11034  DMA_CHANNEL dmaChannel,
11035  uint32_t sourceStartAddress)
11036  Summary:
11037  Writes the specified source start address into the register
11038  corresponding to the specified channel.
11039  Description:
11040  This function writes the specified Source start address into the register
11041  corresponding to the specified channel.
11042  Precondition:
11043  None.
11044  Parameters:
11045  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11046  sourceStartAddress - The source start address
11047  Returns:
11048  None.
11049  Example:
11050  <code>
11051  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11052  uint32_t sourceStartAddress = 0x00FDEA00;
11053  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11054  spiDMAChannel,
11055  sourceStartAddress );
11056  </code>
11057  Remarks:
11058  This function implements an operation of the ChannelXSourceStartAddress feature.
11059  This feature may not be available on all devices. Please refer to the
11060  specific device data sheet to determine availability or use the
11061  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11062  determine whether this feature is available.
11063 */
11064 
11065 void
11067  DMA_MODULE_ID index ,
11068  DMA_CHANNEL dmaChannel ,
11069  uint32_t sourceStartAddress ) ;
11070 //******************************************************************************
11071 /* Function:
11072  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11073  DMA_CHANNEL dmaChannel )
11074  Summary:
11075  Reads the destination start address configured for the specified channel.
11076  Description:
11077  This function reads the destination start address configured for the specified
11078  channel.
11079  Precondition:
11080  None.
11081  Parameters:
11082  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11083  Returns:
11084  - uint32_t - The destination start address configured for this channel
11085  Example:
11086  <code>
11087  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11088  uint32_t DestinationStartAddress;
11089  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11090  DMA_ID_0,
11091  spiDMAChannel );
11092  </code>
11093  Remarks:
11094  This function implements an operation of the ChannelXDestinationStartAddress feature.
11095  This feature may not be available on all devices. Please refer to the
11096  specific device data sheet to determine availability or use the
11097  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11098  determine whether this feature is available.
11099 */
11100 
11101 uint32_t
11103  DMA_MODULE_ID index ,
11104  DMA_CHANNEL dmaChannel ) ;
11105 //******************************************************************************
11106 /* Function:
11107  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11108  DMA_MODULE_ID index,
11109  DMA_CHANNEL dmaChannel,
11110  uint32_t destinationStartAddress)
11111  Summary:
11112  Writes the specified destination start address into the register corresponding to
11113  the specified channel.
11114  Description:
11115  This function writes the specified destination start address into the register
11116  corresponding to the specified channel.
11117  Precondition:
11118  None.
11119  Parameters:
11120  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11121  destinationStartAddress - The destination start address
11122  Returns:
11123  None.
11124  Example:
11125  <code>
11126  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11127  uint32_t destinationStartAddress = 0x00FDEA00;
11128  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11129  spiDMAChannel,
11130  destinationStartAddress );
11131  </code>
11132  Remarks:
11133  This function implements an operation of the ChannelXDestinationStartAddress feature.
11134  This feature may not be available on all devices. Please refer to the
11135  specific device data sheet to determine availability or use the
11136  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11137  determine whether this feature is available.
11138 */
11139 
11140 void
11142  DMA_MODULE_ID index ,
11143  DMA_CHANNEL dmaChannel ,
11144  uint32_t destinationStartAddress ) ;
11145 // *****************************************************************************
11146 // *****************************************************************************
11147 // Section: DMA Data control Interface functions
11148 // *****************************************************************************
11149 // *****************************************************************************
11150 //******************************************************************************
11151 /* Function:
11152  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11153  DMA_CHANNEL dmaChannel )
11154  Summary:
11155  Reads the source size configured for the specified channel.
11156  Description:
11157  This function reads the source size configured for the specified
11158  channel.
11159  Precondition:
11160  None.
11161  Parameters:
11162  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11163  Returns:
11164  - uint16_t - The Source size configured (in bytes) for this channel.
11165  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11166  device data sheet to determine availability.
11167  Example:
11168  <code>
11169  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11170  uint16_t sourceSize;
11171  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11172  spiDMAChannel );
11173  </code>
11174  Remarks:
11175  This function implements an operation of the ChannelXSourceSize feature.
11176  This feature may not be available on all devices. Please refer to the
11177  specific device data sheet to determine availability or use the
11178  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11179  determine whether this feature is available.
11180 */
11181 
11182 uint16_t
11184  DMA_MODULE_ID index ,
11185  DMA_CHANNEL dmaChannel ) ;
11186 //******************************************************************************
11187 /* Function:
11188  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11189  DMA_CHANNEL dmaChannel,
11190  uint16_t sourceSize)
11191  Summary:
11192  Writes the specified source size into the register corresponding
11193  to the specified channel.
11194  Description:
11195  This function writes the specified source size into the register
11196  corresponding to the specified channel.
11197  Precondition:
11198  None.
11199  Parameters:
11200  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11201  sourceSize - The source size. The source size (8-bit, 16-bit) is
11202  device-specific. Please refer to the specific device data
11203  sheet to determine availability.
11204  Returns:
11205  None.
11206  Example:
11207  <code>
11208  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11209  uint16_t sourceSize = 0xA00;
11210  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11211  spiDMAChannel,
11212  sourceSize );
11213  </code>
11214  Remarks:
11215  This function implements an operation of the ChannelXSourceSize feature.
11216  This feature may not be available on all devices. Please refer to the
11217  specific device data sheet to determine availability or use the
11218  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11219  determine whether this feature is available.
11220 */
11221 
11222 void
11224  DMA_MODULE_ID index ,
11225  DMA_CHANNEL dmaChannel ,
11226  uint16_t sourceSize ) ;
11227 //******************************************************************************
11228 /* Function:
11229  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11230  DMA_CHANNEL dmaChannel )
11231  Summary:
11232  Reads the destination size configured for the specified channel.
11233  Description:
11234  This function reads the destination size configured for the specified
11235  channel.
11236  Precondition:
11237  None.
11238  Parameters:
11239  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11240  Returns:
11241  - uint16_t - The destination size configured (in bytes) for this channel.
11242  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11243  device data sheet to determine availability.
11244  Example:
11245  <code>
11246  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11247  uint16_t DestinationSize;
11248  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11249  spiDMAChannel );
11250  </code>
11251  Remarks:
11252  This function implements an operation of the ChannelXDestinationSize feature.
11253  This feature may not be available on all devices. Please refer to the
11254  specific device data sheet to determine availability or use the
11255  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11256  determine whether this feature is available.
11257 */
11258 
11259 uint16_t
11261  DMA_MODULE_ID index ,
11262  DMA_CHANNEL dmaChannel ) ;
11263 //******************************************************************************
11264 /* Function:
11265  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11266  DMA_CHANNEL dmaChannel,
11267  uint16_t destinationSize)
11268  Summary:
11269  Writes the specified destination size into the register corresponding
11270  to the specified channel.
11271  Description:
11272  This function writes the specified destination size into the register
11273  corresponding to the specified channel.
11274  Precondition:
11275  None.
11276  Parameters:
11277  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11278  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11279  is device-specific. Please refer to the specific device
11280  data sheet to determine availability.)
11281  Returns:
11282  None.
11283  Example:
11284  <code>
11285  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11286  uint16_t destinationSize = 0xA00;
11287  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11288  </code>
11289  Remarks:
11290  This function implements an operation of the ChannelXDestinationSize feature.
11291  This feature may not be available on all devices. Please refer to the
11292  specific device data sheet to determine availability or use the
11293  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11294  determine whether this feature is available.
11295 */
11296 
11297 void
11299  DMA_MODULE_ID index ,
11300  DMA_CHANNEL dmaChannel ,
11301  uint16_t destinationSize ) ;
11302 //******************************************************************************
11303 /* Function:
11304  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11305  DMA_CHANNEL dmaChannel )
11306  Summary:
11307  Reads the current byte of the source being pointed to for the specified channel.
11308  Description:
11309  This function reads the current byte of the source being pointed to for the
11310  specified channel.
11311  Precondition:
11312  None.
11313  Parameters:
11314  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11315  Returns:
11316  - uint16_t - The source byte being pointed to for this channel.
11317  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11318  device data sheet to determine availability.
11319  Example:
11320  <code>
11321  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11322  uint16_t sourcebyte;
11323  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11324  </code>
11325  Remarks:
11326  This function implements an operation of the ChannelXSourcePointer feature.
11327  This feature may not be available on all devices. Please refer to the
11328  specific device data sheet to determine availability or use the
11329  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11330  determine whether this feature is available.
11331 */
11332 
11333 uint16_t
11335  DMA_MODULE_ID index ,
11336  DMA_CHANNEL dmaChannel ) ;
11337 //******************************************************************************
11338 /* Function:
11339  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11340  DMA_CHANNEL dmaChannel )
11341  Summary:
11342  Reads the current byte of the destination being pointed to for the specified channel.
11343  Description:
11344  This function reads the current byte of the destination being pointed to for the
11345  specified channel.
11346  Precondition:
11347  None.
11348  Parameters:
11349  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11350  Returns:
11351  - uint16_t - The destination byte being pointed to for this channel.
11352  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11353  device data sheet to determine availability.
11354  Example:
11355  <code>
11356  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11357  uint16_t destinationbyte;
11358  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11359  spiDMAChannel );
11360  </code>
11361  Remarks:
11362  This function implements an operation of the ChannelXDestinationPointer feature.
11363  This feature may not be available on all devices. Please refer to the
11364  specific device data sheet to determine availability or use the
11365  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11366  determine whether this feature is available.
11367 */
11368 
11369 uint16_t
11371  DMA_MODULE_ID index ,
11372  DMA_CHANNEL dmaChannel ) ;
11373 //******************************************************************************
11374 /* Function:
11375  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11376  DMA_CHANNEL dmaChannel )
11377  Summary:
11378  Reads the cell size (in bytes) configured for the specified channel.
11379  Description:
11380  This function reads the cell size (in bytes) configured for the specified
11381  channel.
11382  Precondition:
11383  None.
11384  Parameters:
11385  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11386  Returns:
11387  - uint16_t - The cell size configured (in bytes) for this channel
11388  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11389  device data sheet to determine availability.
11390  Example:
11391  <code>
11392  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11393  uint16_t cellSize;
11394  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11395  spiDMAChannel );
11396  </code>
11397  Remarks:
11398  This function implements an operation of the ChannelXCellSize feature.
11399  This feature may not be available on all devices. Please refer to the
11400  specific device data sheet to determine availability or use the
11401  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11402  determine whether this feature is available.
11403 */
11404 
11405 uint16_t
11407  DMA_MODULE_ID index ,
11408  DMA_CHANNEL dmaChannel ) ;
11409 //******************************************************************************
11410 /* Function:
11411  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11412  DMA_CHANNEL dmaChannel,
11413  uint16_t cellSize)
11414  Summary:
11415  Writes the specified cell size into the register corresponding
11416  to the specified channel.
11417  Description:
11418  This function writes the specified cell size into the register
11419  corresponding to the specified channel.
11420  Precondition:
11421  None.
11422  Parameters:
11423  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11424  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11425  device-specific. Please refer to the specific device data
11426  sheet to determine availability.)
11427  Returns:
11428  None.
11429  Example:
11430  <code>
11431  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11432  uint16_t cellSize = 0x10;
11433  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11434  </code>
11435  Remarks:
11436  This function implements an operation of the ChannelXCellSize feature.
11437  This feature may not be available on all devices. Please refer to the
11438  specific device data sheet to determine availability or use the
11439  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11440  determine whether this feature is available.
11441 */
11442 
11443 void
11445  DMA_MODULE_ID index ,
11446  DMA_CHANNEL dmaChannel ,
11447  uint16_t CellSize ) ;
11448 //******************************************************************************
11449 /* Function:
11450  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11451  DMA_CHANNEL dmaChannel )
11452  Summary:
11453  Returns the number of bytes transferred since the last event.
11454  Description:
11455  This function returns the number of bytes transferred since the last event.
11456  Precondition:
11457  None.
11458  Parameters:
11459  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11460  Returns:
11461  - uint16_t - The number of bytes transferred since the last event.
11462  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11463  the specific device data sheet to determine availability.
11464  Example:
11465  <code>
11466  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11467  uint16_t CellProgress;
11468  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11469  spiDMAChannel );
11470  </code>
11471  Remarks:
11472  This function implements an operation of the ChannelXCellProgressPointer feature.
11473  This feature may not be available on all devices. Please refer to the
11474  specific device data sheet to determine availability or use the
11475  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11476  determine whether this feature is available.
11477 */
11478 
11479 uint16_t
11481  DMA_MODULE_ID index ,
11482  DMA_CHANNEL dmaChannel ) ;
11483 //******************************************************************************
11484 /* Function:
11485  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11486  DMA_CHANNEL dmaChannel )
11487  Summary:
11488  Returns the pattern matching (for DMA abort) data programmed for the specified
11489  channel.
11490  Description:
11491  This function returns pattern matching (for DMA abort) data programmed for
11492  the specified channel.
11493  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11494  the specific device data sheet to determine availability.)
11495  Precondition:
11496  None.
11497  Parameters:
11498  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11499  Returns:
11500  - uint16_t - The pattern matching data programmed for the current channel.
11501  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11502  the specific device data sheet to determine availability.
11503  Example:
11504  <code>
11505  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11506  uint16_t patternData;
11507  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11508  </code>
11509  Remarks:
11510  This function implements an operation of the ChannelXPatternData feature.
11511  This feature may not be available on all devices. Please refer to the
11512  specific device data sheet to determine availability or use the
11513  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11514  determine whether this feature is available.
11515 */
11516 
11517 uint16_t
11519  DMA_MODULE_ID index ,
11520  DMA_CHANNEL dmaChannel ) ;
11521 //******************************************************************************
11522 /* Function:
11523  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11524  DMA_CHANNEL dmaChannel,
11525  uint16_t patternData)
11526  Summary:
11527  Writes the specified pattern matching data (for DMA abort) into the register
11528  corresponding to the specified channel.
11529  Description:
11530  This function writes the specified pattern matching data (for DMA abort) into the
11531  register corresponding to the specified channel.
11532  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11533  the specific device data sheet to determine availability.)
11534  Precondition:
11535  None.
11536  Parameters:
11537  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11538  patternData - The pattern matching DATA programmed for the current channel
11539  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11540  the specific device data sheet to determine availability.)
11541  Returns:
11542  None.
11543  Example:
11544  <code>
11545  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11546  uint16_t patternData = '\0';
11547  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
11548  </code>
11549  Remarks:
11550  This function implements an operation of the ChannelXPatternData feature.
11551  This feature may not be available on all devices. Please refer to the
11552  specific device data sheet to determine availability or use the
11553  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11554  determine whether this feature is available.
11555 */
11556 
11557 void
11559  DMA_MODULE_ID index ,
11560  DMA_CHANNEL dmaChannel ,
11561  uint16_t patternData ) ;
11562 // *****************************************************************************
11563 // *****************************************************************************
11564 // Section: DMA Interrupt Control Interface functions
11565 // *****************************************************************************
11566 // *****************************************************************************
11567 //******************************************************************************
11568 /* Function:
11569  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
11570  DMA_CHANNEL dmaChannel,
11571  DMA_INT_TYPE dmaINTSource )
11572  Summary:
11573  Returns the status of the interrupt flag of the specified DMA interrupt source
11574  for the specified channel.
11575  Description:
11576  This function returns the status of the interrupt flag of the specified DMA interrupt
11577  source for the specified channel.
11578  Precondition:
11579  None.
11580  Parameters:
11581  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11582  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11583  Returns:
11584  - true - The interrupt flag is set
11585  - false - The interrupt flag is not set
11586  Example:
11587  <code>
11588  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11589  bool AddressErrorINTStatus;
11590  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
11591  DMA_ID_0,
11592  spiDMAChannel,
11593  DMA_INT_ADDRESS_ERROR );
11594  </code>
11595  Remarks:
11596  This function implements an operation of the ChannelXINTSourceFlag feature.
11597  This feature may not be available on all devices. Please refer to the
11598  specific device data sheet to determine availability or use the
11599  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11600  determine whether this feature is available.
11601 */
11602 
11603 bool
11605  DMA_MODULE_ID index ,
11606  DMA_CHANNEL dmaChannel ,
11607  DMA_INT_TYPE dmaINTSource ) ;
11608 //******************************************************************************
11609 /* Function:
11610  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
11611  DMA_CHANNEL dmaChannel,
11612  DMA_INT_TYPE dmaINTSource )
11613  Summary:
11614  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
11615  Description:
11616  This function sets the interrupt flag of the specified DMA interrupt source for
11617  the specified channel.
11618  Precondition:
11619  None.
11620  Parameters:
11621  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11622  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11623  Returns:
11624  None.
11625  Example:
11626  <code>
11627  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11628  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
11629  spiDMAChannel,
11630  DMA_INT_ADDRESS_ERROR );
11631  </code>
11632  Remarks:
11633  This function implements an operation of the ChannelXINTSourceFlag feature.
11634  This feature may not be available on all devices. Please refer to the
11635  specific device data sheet to determine availability or use the
11636  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11637  determine whether this feature is available.
11638 */
11639 
11640 void
11642  DMA_MODULE_ID index ,
11643  DMA_CHANNEL dmaChannel ,
11644  DMA_INT_TYPE dmaINTSource ) ;
11645 //******************************************************************************
11646 /* Function:
11647  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
11648  DMA_CHANNEL dmaChannel,
11649  DMA_INT_TYPE dmaINTSource )
11650  Summary:
11651  Clears the interrupt flag of the specified DMA interrupt source
11652  for the specified channel.
11653  Description:
11654  This function clears the interrupt flag of the specified DMA interrupt source
11655  for the specified channel.
11656  Precondition:
11657  None.
11658  Parameters:
11659  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11660  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11661  Returns:
11662  None.
11663  Example:
11664  <code>
11665  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11666  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
11667  spiDMAChannel,
11668  DMA_INT_ADDRESS_ERROR );
11669  </code>
11670  Remarks:
11671  This function implements an operation of the ChannelXINTSourceFlag feature.
11672  This feature may not be available on all devices. Please refer to the
11673  specific device data sheet to determine availability or use the
11674  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11675  determine whether this feature is available.
11676 */
11677 
11678 void
11680  DMA_MODULE_ID index ,
11681  DMA_CHANNEL dmaChannel ,
11682  DMA_INT_TYPE dmaINTSource ) ;
11683 //******************************************************************************
11684 /* Function:
11685  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
11686  DMA_CHANNEL dmaChannel,
11687  DMA_INT_TYPE dmaINTSource )
11688  Summary:
11689  Enables the specified interrupt source for the specified channel.
11690  Description:
11691  This function enables the specified interrupt source for the specified channel.
11692  Precondition:
11693  None.
11694  Parameters:
11695  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11696  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11697  Returns:
11698  None.
11699  Example:
11700  <code>
11701  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11702  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
11703  spiDMAChannel,
11704  DMA_INT_ADDRESS_ERROR );
11705  </code>
11706  Remarks:
11707  This function implements an operation of the ChannelXINTSource feature.
11708  This feature may not be available on all devices. Please refer to the
11709  specific device data sheet to determine availability or use the
11710  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11711  determine whether this feature is available.
11712 */
11713 
11714 void
11716  DMA_MODULE_ID index ,
11717  DMA_CHANNEL dmaChannel ,
11718  DMA_INT_TYPE dmaINTSource ) ;
11719 //******************************************************************************
11720 /* Function:
11721  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
11722  DMA_CHANNEL dmaChannel,
11723  DMA_INT_TYPE dmaINTSource )
11724  Summary:
11725  Disables the specified interrupt source for the specified channel.
11726  Description:
11727  This function disables the specified interrupt source for the specified channel.
11728  Precondition:
11729  None.
11730  Parameters:
11731  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11732  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11733  Returns:
11734  None.
11735  Example:
11736  <code>
11737  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11738  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
11739  spiDMAChannel,
11740  DMA_INT_ADDRESS_ERROR );
11741  </code>
11742  Remarks:
11743  This function implements an operation of the ChannelXINTSource feature.
11744  This feature may not be available on all devices. Please refer to the
11745  specific device data sheet to determine availability or use the
11746  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11747  determine whether this feature is available.
11748 */
11749 
11750 void
11752  DMA_MODULE_ID index ,
11753  DMA_CHANNEL dmaChannel ,
11754  DMA_INT_TYPE dmaINTSource ) ;
11755 //******************************************************************************
11756 /* Function:
11757  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
11758  DMA_CHANNEL dmaChannel,
11759  DMA_INT_TYPE dmaINTSource )
11760  Summary:
11761  Returns the enable status of the specified interrupt source for the specified channel.
11762  Description:
11763  This function returns the enable status of the specified interrupt source for the
11764  specified channel.
11765  Precondition:
11766  None.
11767  Parameters:
11768  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11769  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11770  Returns:
11771  - true - The interrupt is enabled
11772  - false - The interrupt is not enabled
11773  Example:
11774  <code>
11775  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11776  bool dmaINTSourceEnableStatus;
11777  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
11778  DMA_ID_0,
11779  spiDMAChannel,
11780  DMA_INT_ADDRESS_ERROR );
11781  </code>
11782  Remarks:
11783  This function implements an operation of the ChannelXINTSource feature.
11784  This feature may not be available on all devices. Please refer to the
11785  specific device data sheet to determine availability or use the
11786  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11787  determine whether this feature is available.
11788 */
11789 
11790 bool
11792  DMA_MODULE_ID index ,
11793  DMA_CHANNEL dmaChannel ,
11794  DMA_INT_TYPE dmaINTSource ) ;
11795 //******************************************************************************
11796 /* Function:
11797  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
11798  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
11799  Summary:
11800  Sets the pattern match length.
11801  Description:
11802  This function sets the length of the pattern match ignore to 1 or 2 bytes.
11803  Precondition:
11804  None.
11805  Parameters:
11806  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11807  patternLen - Length of pattern match (either 1 or 2)
11808  Returns:
11809  None.
11810  Example:
11811  <code>
11812  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11813  DMA_PATTERN_LENGTH patternLen;
11814  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
11815  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
11816  </code>
11817  Remarks:
11818  This function implements an operation of the ChannelXPatternLength feature.
11819  This feature may not be available on all devices. Please refer to the
11820  specific device data sheet to determine availability or use the
11821  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11822  determine whether this feature is available.
11823 */
11824 
11825 void
11827  DMA_MODULE_ID index ,
11828  DMA_CHANNEL dmaChannel ,
11829  DMA_PATTERN_LENGTH patternLen ) ;
11830 //******************************************************************************
11831 /* Function:
11832  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
11833  DMA_CHANNEL dmaChannel);
11834  Summary:
11835  Returns the pattern match length.
11836  Description:
11837  This function returns the length of the byte matching the CHPIGN bits during a
11838  pattern match that may be ignored during the pattern match determination when
11839  the CHPIGNEN bit is set.
11840  Precondition:
11841  None.
11842  Parameters:
11843  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11844  Returns:
11845  - patternLen - Length of pattern match (either 1 or 2)
11846  Example:
11847  <code>
11848  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11849  DMA_PATTERN_LENGTH patternLen;
11850  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
11851  </code>
11852  Remarks:
11853  This function implements an operation of the ChannelXPatternLength feature.
11854  This feature may not be available on all devices. Please refer to the
11855  specific device data sheet to determine availability or use the
11856  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11857  determine whether this feature is available.
11858 */
11859 
11860 DMA_PATTERN_LENGTH
11862  DMA_MODULE_ID index ,
11863  DMA_CHANNEL dmaChannel ) ;
11864 //******************************************************************************
11865 /* Function:
11866  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
11867  DMA_CHANNEL channel );
11868  Summary:
11869  Enables the pattern match ignore byte.
11870  Description:
11871  This function enables the pattern match ignore byte.
11872  Precondition:
11873  None.
11874  Parameters:
11875  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11876  Returns:
11877  None.
11878  Example:
11879  <code>
11880  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11881  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
11882  </code>
11883  Remarks:
11884  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11885  This feature may not be available on all devices. Please refer to the
11886  specific device data sheet to determine availability or use the
11887  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11888  determine whether this feature is available.
11889 */
11890 
11891 void
11893  DMA_MODULE_ID index ,
11894  DMA_CHANNEL channel ) ;
11895 //******************************************************************************
11896 /* Function:
11897  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
11898  DMA_CHANNEL channel );
11899  Summary:
11900  Returns the state of the pattern match ignore byte.
11901  Description:
11902  This function returns the state (enabled or disabled) of the pattern match
11903  ignore byte.
11904  Precondition:
11905  None.
11906  Parameters:
11907  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11908  Returns:
11909  - true - The pattern match ignore byte is enabled
11910  - false - The pattern match ignore byte is disabled
11911  Example:
11912  <code>
11913  bool patternIsEnabled;
11914  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11915  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
11916  </code>
11917  Remarks:
11918  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11919  This feature may not be available on all devices. Please refer to the
11920  specific device data sheet to determine availability or use the
11921  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11922  determine whether this feature is available.
11923 */
11924 
11925 bool
11927  DMA_MODULE_ID index ,
11928  DMA_CHANNEL channel ) ;
11929 //******************************************************************************
11930 /* Function:
11931  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
11932  DMA_CHANNEL channel );
11933  Summary:
11934  Disables the pattern match ignore byte.
11935  Description:
11936  This function disables the pattern match ignore byte.
11937  Precondition:
11938  None.
11939  Parameters:
11940  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11941  Returns:
11942  None.
11943  Example:
11944  <code>
11945  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11946  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
11947  </code>
11948  Remarks:
11949  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11950  This feature may not be available on all devices. Please refer to the
11951  specific device data sheet to determine availability or use the
11952  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11953  determine whether this feature is available.
11954 */
11955 
11956 void
11958  DMA_MODULE_ID index ,
11959  DMA_CHANNEL channel ) ;
11960 //******************************************************************************
11961 /* Function:
11962  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
11963  DMA_CHANNEL channel, uint8_t pattern );
11964  Summary:
11965  Sets the pattern match ignore value.
11966  Description:
11967  This function sets the value of the pattern match ignore.
11968  Precondition:
11969  None.
11970  Parameters:
11971  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11972  pattern - Pattern match ignore value
11973  Returns:
11974  None.
11975  Example:
11976  <code>
11977  uint8_t patternMatch = 0x8;
11978  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11979  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
11980  </code>
11981  Remarks:
11982  This function implements an operation of the ChannelXPatternIgnore feature.
11983  This feature may not be available on all devices. Please refer to the
11984  specific device data sheet to determine availability or use the
11985  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
11986  determine whether this feature is available.
11987 */
11988 
11989 void
11991  DMA_MODULE_ID index ,
11992  DMA_CHANNEL channel ,
11993  uint8_t pattern ) ;
11994 //******************************************************************************
11995 /* Function:
11996  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
11997  DMA_CHANNEL channel );
11998  Summary:
11999  Returns the pattern match ignore value.
12000  Description:
12001  This function returns the value of the pattern match ignore.
12002  Precondition:
12003  None.
12004  Parameters:
12005  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12006  Returns:
12007  - uint8_t - Pattern match ignore value
12008  Example:
12009  <code>
12010  uint8_t patternMatch;
12011  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12012  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12013  </code>
12014  Remarks:
12015  This function implements an operation of the ChannelXPatternIgnore feature.
12016  This feature may not be available on all devices. Please refer to the
12017  specific device data sheet to determine availability or use the
12018  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12019  determine whether this feature is available.
12020 */
12021 
12022 uint8_t
12024  DMA_MODULE_ID index ,
12025  DMA_CHANNEL channel ) ;
12026 // *****************************************************************************
12027 // *****************************************************************************
12028 // Section: DMA Peripheral Library Exists API Routines
12029 // *****************************************************************************
12030 // *****************************************************************************
12031 /* The following functions indicate the existence of the features on the device.
12032 */
12033 //******************************************************************************
12034 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12035  Summary:
12036  Identifies whether the Busy feature exists on the DMA module.
12037  Description:
12038  This function identifies whether the Busy feature is available on the
12039  DMA module.
12040  When this function returns true, these functions are supported on the device:
12041  - PLIB_DMA_BusyActiveSet
12042  - PLIB_DMA_BusyActiveReset
12043  - PLIB_DMA_IsBusy
12044  Preconditions:
12045  None.
12046  Parameters:
12047  index - Identifier for the device instance
12048  Returns:
12049  - true - The Busy feature is supported on the device
12050  - false - The Busy feature is not supported on the device
12051  Remarks:
12052  None.
12053 */
12054 
12055 bool
12057  DMA_MODULE_ID index ) ;
12058 //******************************************************************************
12059 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12060  Summary:
12061  Identifies whether the Suspend feature exists on the DMA module.
12062  Description:
12063  This function identifies whether the Suspend feature is available on the
12064  DMA module.
12065  When this function returns true, these functions are supported on the device:
12066  - PLIB_DMA_SuspendEnable
12067  - PLIB_DMA_SuspendDisable
12068  - PLIB_DMA_SuspendIsEnabled
12069  Preconditions:
12070  None.
12071  Parameters:
12072  index - Identifier for the device instance
12073  Returns:
12074  - true - The Suspend feature is supported on the device
12075  - false - The Suspend feature is not supported on the device
12076  Remarks:
12077  None.
12078 */
12079 
12080 bool
12082  DMA_MODULE_ID index ) ;
12083 //******************************************************************************
12084 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12085  Summary:
12086  Identifies whether the StopInIdle feature exists on the DMA module.
12087  Description:
12088  This function identifies whether the StopInIdle feature is available on the
12089  DMA module.
12090  When this function returns true, these functions are supported on the device:
12091  - PLIB_DMA_StopInIdleEnable
12092  - PLIB_DMA_StopInIdleDisable
12093  Preconditions:
12094  None.
12095  Parameters:
12096  index - Identifier for the device instance
12097  Returns:
12098  - true - The StopInIdle feature is supported on the device
12099  - false - The StopInIdle feature is not supported on the device
12100  Remarks:
12101  None.
12102 */
12103 
12104 bool
12106  DMA_MODULE_ID index ) ;
12107 //******************************************************************************
12108 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12109  Summary:
12110  Identifies whether the EnableControl feature exists on the DMA module.
12111  Description:
12112  This function identifies whether the EnableControl feature is available on
12113  the DMA module.
12114  When this function returns true, these functions are supported on the device:
12115  - PLIB_DMA_Enable
12116  - PLIB_DMA_Disable
12117  - PLIB_DMA_IsEnabled
12118  Preconditions:
12119  None.
12120  Parameters:
12121  index - Identifier for the device instance
12122  Returns:
12123  - true - The EnableControl feature is supported on the device
12124  - false - The EnableControl feature is not supported on the device
12125  Remarks:
12126  None.
12127 */
12128 
12129 bool
12131  DMA_MODULE_ID index ) ;
12132 //******************************************************************************
12133 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12134  Summary:
12135  Identifies whether the ChannelBits feature exists on the DMA module.
12136  Description:
12137  This function identifies whether the ChannelBits feature is available on the
12138  DMA module.
12139  When this function returns true, this function is supported on the device:
12140  - PLIB_DMA_ChannelBitsGet
12141  Preconditions:
12142  None.
12143  Parameters:
12144  index - Identifier for the device instance
12145  Returns:
12146  - true - The ChannelBits feature is supported on the device
12147  - false - The ChannelBits feature is not supported on the device
12148  Remarks:
12149  None.
12150 */
12151 
12152 bool
12154  DMA_MODULE_ID index ) ;
12155 //******************************************************************************
12156 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12157  Summary:
12158  Identifies whether the LastBusAccess feature exists on the DMA module.
12159  Description:
12160  This function identifies whether the LastBusAccess feature is available on the
12161  DMA module.
12162  When this function returns true, these functions are supported on the device:
12163  - PLIB_DMA_LastBusAccessIsRead
12164  - PLIB_DMA_LastBusAccessIsWrite
12165  Preconditions:
12166  None.
12167  Parameters:
12168  index - Identifier for the device instance
12169  Returns:
12170  - true - The LastBusAccess feature is supported on the device
12171  - false - The LastBusAccess feature is not supported on the device
12172  Remarks:
12173  None.
12174 */
12175 
12176 bool
12178  DMA_MODULE_ID index ) ;
12179 //******************************************************************************
12180 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12181  Summary:
12182  Identifies whether the RecentAddress feature exists on the DMA module.
12183  Description:
12184  This function identifies whether the RecentAddress feature is available on
12185  the DMA module.
12186  When this function returns true, this function is supported on the device:
12187  - PLIB_DMA_RecentAddressAccessed
12188  Preconditions:
12189  None.
12190  Parameters:
12191  index - Identifier for the device instance
12192  Returns:
12193  - true - The RecentAddress feature is supported on the device
12194  - false - The RecentAddress feature is not supported on the device
12195  Remarks:
12196  None.
12197 */
12198 
12199 bool
12201  DMA_MODULE_ID index ) ;
12202 //******************************************************************************
12203 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12204  Summary:
12205  Identifies whether the CRCChannel feature exists on the DMA module.
12206  Description:
12207  This function identifies whether the CRCChannel feature is available on the
12208  DMA module.
12209  When this function returns true, these functions are supported on the device:
12210  - PLIB_DMA_CRCChannelSelect
12211  - PLIB_DMA_CRCChannelGet
12212  Preconditions:
12213  None.
12214  Parameters:
12215  index - Identifier for the device instance
12216  Returns:
12217  - true - The CRCChannel feature is supported on the device
12218  - false - The CRCChannel feature is not supported on the device
12219  Remarks:
12220  None.
12221 */
12222 
12223 bool
12225  DMA_MODULE_ID index ) ;
12226 //******************************************************************************
12227 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12228  Summary:
12229  Identifies whether the CRCType feature exists on the DMA module.
12230  Description:
12231  This function identifies whether the CRCType feature is available on the
12232  DMA module.
12233  When this function returns true, these functions are supported on the device:
12234  - PLIB_DMA_CRCTypeGet
12235  - PLIB_DMA_CRCTypeSet
12236  Preconditions:
12237  None.
12238  Parameters:
12239  index - Identifier for the device instance
12240  Returns:
12241  - true - The CRCType feature is supported on the device
12242  - false - The CRCType feature is not supported on the device
12243  Remarks:
12244  None.
12245 */
12246 
12247 bool
12249  DMA_MODULE_ID index ) ;
12250 //******************************************************************************
12251 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12252  Summary:
12253  Identifies whether the CRCAppendMode feature exists on the DMA module.
12254  Description:
12255  This function identifies whether the CRCAppendMode feature is available on
12256  the DMA module.
12257  When this function returns true, these functions are supported on the device:
12258  - PLIB_DMA_CRCAppendModeEnable
12259  - PLIB_DMA_CRCAppendModeDisable
12260  - PLIB_DMA_CRCAppendModeIsEnabled
12261  Preconditions:
12262  None.
12263  Parameters:
12264  index - Identifier for the device instance
12265  Returns:
12266  - true - The CRCAppendMode feature is supported on the device
12267  - false - The CRCAppendMode feature is not supported on the device
12268  Remarks:
12269  None.
12270 */
12271 
12272 bool
12274  DMA_MODULE_ID index ) ;
12275 //******************************************************************************
12276 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12277  Summary:
12278  Identifies whether the CRC feature exists on the DMA module.
12279  Description:
12280  This function identifies whether the CRC feature is available on the DMA module.
12281  When this function returns true, these functions are supported on the device:
12282  - PLIB_DMA_CRCEnable
12283  - PLIB_DMA_CRCDisable
12284  - PLIB_DMA_CRCIsEnabled
12285  Preconditions:
12286  None.
12287  Parameters:
12288  index - Identifier for the device instance
12289  Returns:
12290  - true - The CRC feature is supported on the device
12291  - false - The CRC feature is not supported on the device
12292  Remarks:
12293  None.
12294 */
12295 
12296 bool
12298  DMA_MODULE_ID index ) ;
12299 //******************************************************************************
12300 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12301  Summary:
12302  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12303  Description:
12304  This function identifies whether the CRCPolynomialLength feature is available
12305  on the DMA module.
12306  When this function returns true, these functions are supported on the device:
12307  - PLIB_DMA_CRCPolynomialLengthSet
12308  - PLIB_DMA_CRCPolynomialLengthGet
12309  Preconditions:
12310  None.
12311  Parameters:
12312  index - Identifier for the device instance
12313  Returns:
12314  - true - The CRCPolynomialLength feature is supported on the device
12315  - false - The CRCPolynomialLength feature is not supported on the device
12316  Remarks:
12317  None.
12318 */
12319 
12320 bool
12322  DMA_MODULE_ID index ) ;
12323 //******************************************************************************
12324 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12325  Summary:
12326  Identifies whether the CRCBitOrder feature exists on the DMA module.
12327  Description:
12328  This function identifies whether the CRCBitOrder feature is available on the
12329  DMA module.
12330  When this function returns true, this function is supported on the device:
12331  - PLIB_DMA_CRCBitOrderSelect
12332  Preconditions:
12333  None.
12334  Parameters:
12335  index - Identifier for the device instance
12336  Returns:
12337  - true - The CRCBitOrder feature is supported on the device
12338  - false - The CRCBitOrder feature is not supported on the device
12339  Remarks:
12340  None.
12341 */
12342 
12343 bool
12345  DMA_MODULE_ID index ) ;
12346 //******************************************************************************
12347 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12348  Summary:
12349  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12350  Description:
12351  This function identifies whether the CRCWriteByteOrder feature is available
12352  on the DMA module.
12353  When this function returns true, these functions are supported on the device:
12354  - PLIB_DMA_CRCWriteByteOrderAlter
12355  - PLIB_DMA_CRCWriteByteOrderMaintain
12356  Preconditions:
12357  None.
12358  Parameters:
12359  index - Identifier for the device instance
12360  Returns:
12361  - true - The CRCWriteByteOrder feature is supported on the device
12362  - false - The CRCWriteByteOrder feature is not supported on the device
12363  Remarks:
12364  None.
12365 */
12366 
12367 bool
12369  DMA_MODULE_ID index ) ;
12370 //******************************************************************************
12371 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12372  Summary:
12373  Identifies whether the CRCByteOrder feature exists on the DMA module.
12374  Description:
12375  This function identifies whether the CRCByteOrder feature is available on
12376  the DMA module.
12377  When this function returns true, these functions are supported on the device:
12378  - PLIB_DMA_CRCByteOrderSelect
12379  - PLIB_DMA_CRCByteOrderGet
12380  Preconditions:
12381  None.
12382  Parameters:
12383  index - Identifier for the device instance
12384  Returns:
12385  - true - The CRCByteOrder feature is supported on the device
12386  - false - The CRCByteOrder feature is not supported on the device
12387  Remarks:
12388  None.
12389 */
12390 
12391 bool
12393  DMA_MODULE_ID index ) ;
12394 //******************************************************************************
12395 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12396  Summary:
12397  Identifies whether the CRCData feature exists on the DMA module.
12398  Description:
12399  This function identifies whether the CRCData feature is available on the
12400  DMA module.
12401  When this function returns true, these functions are supported on the device:
12402  - PLIB_DMA_CRCDataRead
12403  - PLIB_DMA_CRCDataWrite
12404  Preconditions:
12405  None.
12406  Parameters:
12407  index - Identifier for the device instance
12408  Returns:
12409  - true - The CRCData feature is supported on the device
12410  - false - The CRCData feature is not supported on the device
12411  Remarks:
12412  None.
12413 */
12414 
12415 bool
12417  DMA_MODULE_ID index ) ;
12418 //******************************************************************************
12419 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12420  Summary:
12421  Identifies whether the CRCXOREnable feature exists on the DMA module.
12422  Description:
12423  This function identifies whether the CRCXOREnable feature is available on the
12424  DMA module.
12425  When this function returns true, these functions are supported on the device:
12426  - PLIB_DMA_CRCXOREnableSet
12427  - PLIB_DMA_CRCXOREnableGet
12428  Preconditions:
12429  None.
12430  Parameters:
12431  index - Identifier for the device instance
12432  Returns:
12433  - true - The CRCXOREnable feature is supported on the device
12434  - false - The CRCXOREnable feature is not supported on the device
12435  Remarks:
12436  None.
12437 */
12438 
12439 bool
12441  DMA_MODULE_ID index ) ;
12442 //******************************************************************************
12443 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12444  Summary:
12445  Identifies whether the ChannelXPriority feature exists on the DMA module.
12446  Description:
12447  This function identifies whether the ChannelXPriority feature is available on
12448  the DMA module.
12449  When this function returns true, these functions are supported on the device:
12450  - PLIB_DMA_ChannelXPrioritySelect
12451  - PLIB_DMA_ChannelXPriorityGet
12452  Preconditions:
12453  None.
12454  Parameters:
12455  index - Identifier for the device instance
12456  Returns:
12457  - true - The ChannelXPriority feature is supported on the device
12458  - false - The ChannelXPriority feature is not supported on the device
12459  Remarks:
12460  None.
12461 */
12462 
12463 bool
12465  DMA_MODULE_ID index ) ;
12466 //******************************************************************************
12467 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12468  Summary:
12469  Identifies whether the ChannelXEvent feature exists on the DMA module.
12470  Description:
12471  This function identifies whether the ChannelXEvent feature is available on
12472  the DMA module.
12473  When this function returns true, this function is supported on the device:
12474  - PLIB_DMA_ChannelXEventIsDetected
12475  Preconditions:
12476  None.
12477  Parameters:
12478  index - Identifier for the device instance
12479  Returns:
12480  - true - The ChannelXEvent feature is supported on the device
12481  - false - The ChannelXEvent feature is not supported on the device
12482  Remarks:
12483  None.
12484 */
12485 
12486 bool
12488  DMA_MODULE_ID index ) ;
12489 //******************************************************************************
12490 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12491  Summary:
12492  Identifies whether the ChannelXAuto feature exists on the DMA module.
12493  Description:
12494  This function identifies whether the ChannelXAuto feature is available on
12495  the DMA module.
12496  When this function returns true, these functions are supported on the device:
12497  - PLIB_DMA_ChannelXAutoEnable
12498  - PLIB_DMA_ChannelXAutoDisable
12499  - PLIB_DMA_ChannelXAutoIsEnabled
12500  Preconditions:
12501  None.
12502  Parameters:
12503  index - Identifier for the device instance
12504  Returns:
12505  - true - The ChannelXAuto feature is supported on the device
12506  - false - The ChannelXAuto feature is not supported on the device
12507  Remarks:
12508  None.
12509 */
12510 
12511 bool
12513  DMA_MODULE_ID index ) ;
12514 //******************************************************************************
12515 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12516  Summary:
12517  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12518  Description:
12519  This function identifies whether the ChannelXChainEnbl feature is available
12520  on the DMA module.
12521  When this function returns true, these functions are supported on the device:
12522  - PLIB_DMA_ChannelXChainEnable
12523  - PLIB_DMA_ChannelXChainDisable
12524  - PLIB_DMA_ChannelXChainIsEnabled
12525  Preconditions:
12526  None.
12527  Parameters:
12528  index - Identifier for the device instance
12529  Returns:
12530  - true - The ChannelXChainEnbl feature is supported on the device
12531  - false - The ChannelXChainEnbl feature is not supported on the device
12532  Remarks:
12533  None.
12534 */
12535 
12536 bool
12538  DMA_MODULE_ID index ) ;
12539 //******************************************************************************
12540 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12541  Summary:
12542  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12543  Description:
12544  This function identifies whether the ChannelXDisabled feature is available
12545  on the DMA module.
12546  When this function returns true, these functions are supported on the device:
12547  - PLIB_DMA_ChannelXDisabledEnablesEvents
12548  - PLIB_DMA_ChannelXDisabledDisablesEvents
12549  Preconditions:
12550  None.
12551  Parameters:
12552  index - Identifier for the device instance
12553  Returns:
12554  - true - The ChannelXDisabled feature is supported on the device
12555  - false - The ChannelXDisabled feature is not supported on the device
12556  Remarks:
12557  None.
12558 */
12559 
12560 bool
12562  DMA_MODULE_ID index ) ;
12563 //******************************************************************************
12564 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
12565  Summary:
12566  Identifies whether the ChannelX feature exists on the DMA module.
12567  Description:
12568  This function identifies whether the ChannelX feature is available on the
12569  DMA module.
12570  When this function returns true, these functions are supported on the device:
12571  - PLIB_DMA_ChannelXEnable
12572  - PLIB_DMA_ChannelXIsEnabled
12573  - PLIB_DMA_ChannelXDisable
12574  Preconditions:
12575  None.
12576  Parameters:
12577  index - Identifier for the device instance
12578  Returns:
12579  - true - The ChannelX feature is supported on the device
12580  - false - The ChannelX feature is not supported on the device
12581  Remarks:
12582  None.
12583 */
12584 
12585 bool
12587  DMA_MODULE_ID index ) ;
12588 //******************************************************************************
12589 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
12590  Summary:
12591  Identifies whether the ChannelXChain feature exists on the DMA module.
12592  Description:
12593  This function identifies whether the ChannelXChain feature is available on the
12594  DMA module.
12595  When this function returns true, these functions are supported on the device:
12596  - PLIB_DMA_ChannelXChainToLower
12597  - PLIB_DMA_ChannelXChainToHigher
12598  Preconditions:
12599  None.
12600  Parameters:
12601  index - Identifier for the device instance
12602  Returns:
12603  - true - The ChannelXChain feature is supported on the device
12604  - false - The ChannelXChain feature is not supported on the device
12605  Remarks:
12606  None.
12607 */
12608 
12609 bool
12611  DMA_MODULE_ID index ) ;
12612 //******************************************************************************
12613 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
12614  Summary:
12615  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
12616  Description:
12617  This function identifies whether the ChannelXPatternLength feature is available
12618  on the DMA module.
12619  When this function returns true, these functions are supported on the device:
12620  - PLIB_DMA_ChannelXPatternLengthSet
12621  - PLIB_DMA_ChannelXPatternLengthGet
12622  Preconditions:
12623  None.
12624  Parameters:
12625  index - Identifier for the device instance
12626  Returns:
12627  - true - The ChannelXPatternLength feature is supported on the device
12628  - false - The ChannelXPatternLength feature is not supported on the device
12629  Remarks:
12630  None.
12631 */
12632 
12633 bool
12635  DMA_MODULE_ID index ) ;
12636 //******************************************************************************
12637 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
12638  Summary:
12639  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
12640  module.
12641  Description:
12642  This function identifies whether the ChannelXPatternIgnoreByte feature is
12643  available on the DMA module.
12644  When this function returns true, these functions are supported on the device:
12645  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
12646  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
12647  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
12648  Preconditions:
12649  None.
12650  Parameters:
12651  index - Identifier for the device instance
12652  Returns:
12653  - true - The ChannelXPatternIgnoreByte feature is supported on the device
12654  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
12655  Remarks:
12656  None.
12657 */
12658 
12659 bool
12661  DMA_MODULE_ID index ) ;
12662 //******************************************************************************
12663 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
12664  Summary:
12665  Identifies whether the ChannelXBusy feature exists on the DMA module.
12666  Description:
12667  This function identifies whether the ChannelXBusy feature is available on the
12668  DMA module.
12669  When this function returns true, these functions are supported on the device:
12670  - PLIB_DMA_ChannelXBusyActiveSet
12671  - PLIB_DMA_ChannelXBusyInActiveSet
12672  - PLIB_DMA_ChannelXBusyIsBusy
12673  Preconditions:
12674  None.
12675  Parameters:
12676  index - Identifier for the device instance
12677  Returns:
12678  - true - The ChannelXBusy feature is supported on the device
12679  - false - The ChannelXBusy feature is not supported on the device
12680  Remarks:
12681  None.
12682 */
12683 
12684 bool
12686  DMA_MODULE_ID index ) ;
12687 //******************************************************************************
12688 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
12689  Summary:
12690  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
12691  Description:
12692  This function identifies whether the ChannelXPatternIgnore feature is available
12693  on the DMA module.
12694  When this function returns true, these functions are supported on the device:
12695  - PLIB_DMA_ChannelXPatternIgnoreSet
12696  - PLIB_DMA_ChannelXPatternIgnoreGet
12697  Preconditions:
12698  None.
12699  Parameters:
12700  index - Identifier for the device instance
12701  Returns:
12702  - true - The ChannelXPatternIgnore feature is supported on the device
12703  - false - The ChannelXPatternIgnore feature is not supported on the device
12704  Remarks:
12705  None.
12706 */
12707 
12708 bool
12710  DMA_MODULE_ID index ) ;
12711 //******************************************************************************
12712 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
12713  Summary:
12714  Identifies whether the ChannelXTrigger feature exists on the DMA module.
12715  Description:
12716  This function identifies whether the ChannelXTrigger feature is available on
12717  the DMA module.
12718  When this function returns true, these functions are supported on the device:
12719  - PLIB_DMA_ChannelXTriggerEnable
12720  - PLIB_DMA_ChannelXTriggerIsEnabled
12721  - PLIB_DMA_ChannelXTriggerDisable
12722  Preconditions:
12723  None.
12724  Parameters:
12725  index - Identifier for the device instance
12726  Returns:
12727  - true - The ChannelXTrigger feature is supported on the device
12728  - false - The ChannelXTrigger feature is not supported on the device
12729  Remarks:
12730  None.
12731 */
12732 
12733 bool
12735  DMA_MODULE_ID index ) ;
12736 //******************************************************************************
12737 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
12738  Summary:
12739  Identifies whether the AbortTransfer feature exists on the DMA module.
12740  Description:
12741  This function identifies whether the AbortTransfer feature is available on
12742  the DMA module.
12743  When this function returns true, this function is supported on the device:
12744  - PLIB_DMA_AbortTransferSet
12745  Preconditions:
12746  None.
12747  Parameters:
12748  index - Identifier for the device instance
12749  Returns:
12750  - true - The AbortTransfer feature is supported on the device
12751  - false - The AbortTransfer feature is not supported on the device
12752  Remarks:
12753  None.
12754 */
12755 
12756 bool
12758  DMA_MODULE_ID index ) ;
12759 //******************************************************************************
12760 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
12761  Summary:
12762  Identifies whether the StartTransfer feature exists on the DMA module.
12763  Description:
12764  This function identifies whether the StartTransfer feature is available on
12765  the DMA module.
12766  When this function returns true, this function is supported on the device:
12767  - PLIB_DMA_StartTransferSet
12768  Preconditions:
12769  None.
12770  Parameters:
12771  index - Identifier for the device instance
12772  Returns:
12773  - true - The StartTransfer feature is supported on the device
12774  - false - The StartTransfer feature is not supported on the device
12775  Remarks:
12776  None.
12777 */
12778 
12779 bool
12781  DMA_MODULE_ID index ) ;
12782 //******************************************************************************
12783 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
12784  Summary:
12785  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
12786  Description:
12787  This function identifies whether the ChannelXStartIRQ feature is available
12788  on the DMA module.
12789  When this function returns true, this function is supported on the device:
12790  - PLIB_DMA_ChannelXStartIRQSet
12791  Preconditions:
12792  None.
12793  Parameters:
12794  index - Identifier for the device instance
12795  Returns:
12796  - true - The ChannelXStartIRQ feature is supported on the device
12797  - false - The ChannelXStartIRQ feature is not supported on the device
12798  Remarks:
12799  None.
12800 */
12801 
12802 bool
12804  DMA_MODULE_ID index ) ;
12805 //******************************************************************************
12806 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
12807  Summary:
12808  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
12809  Description:
12810  This function identifies whether the ChannelXAbortIRQ feature is available
12811  on the DMA module.
12812  When this function returns true, this function is supported on the device:
12813  - PLIB_DMA_ChannelXAbortIRQSet
12814  Preconditions:
12815  None.
12816  Parameters:
12817  index - Identifier for the device instance
12818  Returns:
12819  - true - The ChannelXAbortIRQ feature is supported on the device
12820  - false - The ChannelXAbortIRQ feature is not supported on the device
12821  Remarks:
12822  None.
12823 */
12824 
12825 bool
12827  DMA_MODULE_ID index ) ;
12828 //******************************************************************************
12829 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
12830  Summary:
12831  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
12832  Description:
12833  This function identifies whether the ChannelXINTSourceFlag feature is available
12834  on the DMA module.
12835  When this function returns true, these functions are supported on the device:
12836  - PLIB_DMA_ChannelXINTSourceFlagGet
12837  - PLIB_DMA_ChannelXINTSourceFlagSet
12838  - PLIB_DMA_ChannelXINTSourceFlagClear
12839  Preconditions:
12840  None.
12841  Parameters:
12842  index - Identifier for the device instance
12843  Returns:
12844  - true - The ChannelXINTSourceFlag feature is supported on the device
12845  - false - The ChannelXINTSourceFlag feature is not supported on the device
12846  Remarks:
12847  None.
12848 */
12849 
12850 bool
12852  DMA_MODULE_ID index ) ;
12853 //******************************************************************************
12854 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
12855  Summary:
12856  Identifies whether the ChannelXINTSource feature exists on the DMA module.
12857  Description:
12858  This function identifies whether the ChannelXINTSource feature is available
12859  on the DMA module.
12860  When this function returns true, these functions are supported on the device:
12861  - PLIB_DMA_ChannelXINTSourceEnable
12862  - PLIB_DMA_ChannelXINTSourceDisable
12863  - PLIB_DMA_ChannelXINTSourceIsEnabled
12864  Preconditions:
12865  None.
12866  Parameters:
12867  index - Identifier for the device instance
12868  Returns:
12869  - true - The ChannelXINTSource feature is supported on the device
12870  - false - The ChannelXINTSource feature is not supported on the device
12871  Remarks:
12872  None.
12873 */
12874 
12875 bool
12877  DMA_MODULE_ID index ) ;
12878 //******************************************************************************
12879 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
12880  Summary:
12881  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
12882  Description:
12883  This function identifies whether the ChannelXSourceStartAddress feature is available
12884  on the DMA module.
12885  When this function returns true, these functions are supported on the device:
12886  - PLIB_DMA_ChannelXSourceStartAddressGet
12887  - PLIB_DMA_ChannelXSourceStartAddressSet
12888  Preconditions:
12889  None.
12890  Parameters:
12891  index - Identifier for the device instance
12892  Returns:
12893  - true - The ChannelXSourceStartAddress feature is supported on the device
12894  - false - The ChannelXSourceStartAddress feature is not supported on the device
12895  Remarks:
12896  None.
12897 */
12898 
12899 bool
12901  DMA_MODULE_ID index ) ;
12902 //******************************************************************************
12903 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
12904  Summary:
12905  Identifies whether the ChannelXDestinationStartAddress feature exists on
12906  the DMA module.
12907  Description:
12908  This function identifies whether the ChannelXDestinationStartAddress feature
12909  is available on the DMA module.
12910  When this function returns true, these functions are supported on the device:
12911  - PLIB_DMA_ChannelXDestinationStartAddressGet
12912  - PLIB_DMA_ChannelXDestinationStartAddressSet
12913  Preconditions:
12914  None.
12915  Parameters:
12916  index - Identifier for the device instance
12917  Returns:
12918  - true - The ChannelXDestinationStartAddress feature is supported on the device
12919  - false - The ChannelXDestinationStartAddress feature is not supported on the device
12920  Remarks:
12921  None.
12922 */
12923 
12924 bool
12926  DMA_MODULE_ID index ) ;
12927 //******************************************************************************
12928 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
12929  Summary:
12930  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
12931  Description:
12932  This function identifies whether the ChannelXSourceSize feature is available
12933  on the DMA module.
12934  When this function returns true, these functions are supported on the device:
12935  - PLIB_DMA_ChannelXSourceSizeGet
12936  - PLIB_DMA_ChannelXSourceSizeSet
12937  Preconditions:
12938  None.
12939  Parameters:
12940  index - Identifier for the device instance
12941  Returns:
12942  - true - The ChannelXSourceSize feature is supported on the device
12943  - false - The ChannelXSourceSize feature is not supported on the device
12944  Remarks:
12945  None.
12946 */
12947 
12948 bool
12950  DMA_MODULE_ID index ) ;
12951 //******************************************************************************
12952 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
12953  Summary:
12954  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
12955  Description:
12956  This function identifies whether the ChannelXDestinationSize feature is available
12957  on the DMA module.
12958  When this function returns true, these functions are supported on the device:
12959  - PLIB_DMA_ChannelXDestinationSizeGet
12960  - PLIB_DMA_ChannelXDestinationSizeSet
12961  Preconditions:
12962  None.
12963  Parameters:
12964  index - Identifier for the device instance
12965  Returns:
12966  - true - The ChannelXDestinationSize feature is supported on the device
12967  - false - The ChannelXDestinationSize feature is not supported on the device
12968  Remarks:
12969  None.
12970 */
12971 
12972 bool
12974  DMA_MODULE_ID index ) ;
12975 //******************************************************************************
12976 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
12977  Summary:
12978  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
12979  Description:
12980  This function identifies whether the ChannelXSourcePointer feature is available
12981  on the DMA module.
12982  When this function returns true, this function is supported on the device:
12983  - PLIB_DMA_ChannelXSourcePointerGet
12984  Preconditions:
12985  None.
12986  Parameters:
12987  index - Identifier for the device instance
12988  Returns:
12989  - true - The ChannelXSourcePointer feature is supported on the device
12990  - false - The ChannelXSourcePointer feature is not supported on the device
12991  Remarks:
12992  None.
12993 */
12994 
12995 bool
12997  DMA_MODULE_ID index ) ;
12998 //******************************************************************************
12999 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
13000  Summary:
13001  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
13002  Description:
13003  This function identifies whether the ChannelXDestinationPointer feature is available
13004  on the DMA module.
13005  When this function returns true, this function is supported on the device:
13006  - PLIB_DMA_ChannelXDestinationPointerGet
13007  Preconditions:
13008  None.
13009  Parameters:
13010  index - Identifier for the device instance
13011  Returns:
13012  - true - The ChannelXDestinationPointer feature is supported on the device
13013  - false - The ChannelXDestinationPointer feature is not supported on the device
13014  Remarks:
13015  None.
13016 */
13017 
13018 bool
13020  DMA_MODULE_ID index ) ;
13021 //******************************************************************************
13022 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13023  Summary:
13024  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13025  Description:
13026  This function identifies whether the ChannelXCellSize feature is available on
13027  the DMA module.
13028  When this function returns true, these functions are supported on the device:
13029  - PLIB_DMA_ChannelXCellSizeGet
13030  - PLIB_DMA_ChannelXCellSizeSet
13031  Preconditions:
13032  None.
13033  Parameters:
13034  index - Identifier for the device instance
13035  Returns:
13036  - true - The ChannelXCellSize feature is supported on the device
13037  - false - The ChannelXCellSize feature is not supported on the device
13038  Remarks:
13039  None.
13040 */
13041 
13042 bool
13044  DMA_MODULE_ID index ) ;
13045 //******************************************************************************
13046 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13047  Summary:
13048  Identifies whether the ChannelXCellProgressPointer feature exists on the
13049  DMA module.
13050  Description:
13051  This function identifies whether the ChannelXCellProgressPointer feature is
13052  available on the DMA module.
13053  When this function returns true, this function is supported on the device:
13054  - PLIB_DMA_ChannelXCellProgressPointerGet
13055  Preconditions:
13056  None.
13057  Parameters:
13058  index - Identifier for the device instance
13059  Returns:
13060  - true - The ChannelXCellProgressPointer feature is supported on the device
13061  - false - The ChannelXCellProgressPointer feature is not supported on the device
13062  Remarks:
13063  None.
13064 */
13065 
13066 bool
13068  DMA_MODULE_ID index ) ;
13069 //******************************************************************************
13070 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13071  Summary:
13072  Identifies whether the ChannelXPatternData feature exists on the DMA module
13073  Description:
13074  This function identifies whether the ChannelXPatternData feature is available
13075  on the DMA module.
13076  When this function returns true, these functions are supported on the device:
13077  - PLIB_DMA_ChannelXPatternDataGet
13078  - PLIB_DMA_ChannelXPatternDataSet
13079  Preconditions:
13080  None.
13081  Parameters:
13082  index - Identifier for the device instance
13083  Returns:
13084  - true - The ChannelXPatternData feature is supported on the device
13085  - false - The ChannelXPatternData feature is not supported on the device
13086  Remarks:
13087  None.
13088 */
13089 
13090 bool
13092  DMA_MODULE_ID index ) ;
13093 //DOM-IGNORE-BEGIN
13094 //DOM-IGNORE-END
13095  // #ifndef _PLIB_DMA_H
13096 /*******************************************************************************
13097  End of File
13098 */
13099 
13100 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13101 /* CLOSE_FILE Include File */
13102 
13103 // *****************************************************************************
13104 // *****************************************************************************
13105 // Section: Data Types
13106 // *****************************************************************************
13107 // *****************************************************************************
13108 // *****************************************************************************
13109 /* DMA System Service Channel None
13110  Summary:
13111  DMA channel none
13112  Description:
13113  This constant identifies the specification of no choice from client
13114  for allocating a particular DMA channel.
13115  Remarks:
13116  This constant should be used in place of hard-coded numeric literals.
13117 */
13118 //DOM-IGNORE-BEGIN
13119 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13120 //DOM-IGNORE-END
13121 // *****************************************************************************
13122 /* DMA System Service Channel Any
13123  Summary:
13124  Identifies the client specification to allocate any available DMA channel.
13125  Description:
13126  This constant identifies the specification by the client
13127  to allocate any available DMA channel.
13128  Remarks:
13129  This constant should be used in place of hard-coded numeric literals.
13130 */
13131 //DOM-IGNORE-BEGIN
13132 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13133 //DOM-IGNORE-END
13134 // *****************************************************************************
13135 /* DMA System Service Channel Count
13136  Summary:
13137  Identifies the maximum number of DMA channel handles to be defined.
13138  Description:
13139  This constant identifies the maximum number of DMA channel handles
13140  that should be defined.
13141  Remarks:
13142  This value is derived from device-specific header files defined as
13143  part of the peripheral libraries.
13144 */
13145 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13146 // *****************************************************************************
13147 /* DMA System Service Channel Handle
13148  Summary:
13149  Assigns the handle for requested channel.
13150  Description:
13151  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13152  function. This handle is associated with the channel number that is used for
13153  data transfer and it allows the application to track the data transfer.
13154  The channel handle once assigned to a client expires when the
13155  client calls SYS_DMA_ChannelRelease.
13156  exits.
13157  Remarks:
13158  None.
13159 */
13160 
13161 typedef
13162 uintptr_t
13164 // *****************************************************************************
13165 /* DMA System Service Invalid Channel Handle
13166  Summary:
13167  Defines an invalid channel handle.
13168  Description:
13169  This is the definition of an invalid channel handle. An invalid buffer handle
13170  is returned by SYS_DMA_ChannelAllocate function if the channel number
13171  request was not successful.
13172  Remarks:
13173  None.
13174 */
13175 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13176 // *****************************************************************************
13177 /* DMA stop in idle mode
13178  Summary:
13179  Enable/Disable DMA operations in Idle mode.
13180  Description:
13181  This data type allows enabling/disabling of DMA operations in idle mode.
13182  Remarks:
13183  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13184  while initializing the DMA module by calling SYS_DMA_Initialize.
13185  This feature may not be available on all devices. Refer to the specific device
13186  data sheet to determine availability.
13187 */
13188 
13189 typedef
13190  enum
13191  {
13192  /* When the CPU enters idle mode, the DMA module continue operations */
13194  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13196  } SYS_DMA_SIDL ;
13197 // *****************************************************************************
13198 /* DMA Channel chaining priority
13199  Summary:
13200  Identifies the priority of chaining channel.
13201  Description:
13202  This data type identifies the priority of chaining channel.
13203  Channel chaining priority identifies the channel that will be enabled
13204  on completion of block data transfer on the master channel.
13205  Remarks:
13206  None.
13207 */
13208 
13209 typedef
13210  enum
13211  {
13212  /* Chain to channel higher in natural priority */
13214  /* Chain to channel lower in natural priority */
13217 // *****************************************************************************
13218 /* DMA Channel ignore pattern match
13219  Summary:
13220  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13221  pattern.
13222  Description:
13223  This data type allows enabling/disabling the feature to ignore a byte
13224  between a 2-byte match abort pattern.
13225  Remarks:
13226  This feature may not be available on all devices. Refer to the specific device
13227  data sheet to determine availability.
13228 */
13229 
13230 typedef
13231  enum
13232  {
13233  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13235  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13238 // *****************************************************************************
13239 /* DMA channel CRC mode
13240  Summary:
13241  Identifies the operation mode of the CRC module.
13242  Description:
13243  This data type identifies CRC operating mode. The CRC computation can be
13244  in background mode or append mode.
13245  Remarks:
13246  None.
13247 */
13248 
13249 typedef
13250  enum
13251  {
13252  /* DMA reads the data from the source, passes it through the CRC module and
13253  writes it to the destination. the calculated CRC is left in the DCRCDATA
13254  register at the end of the block transfer. */
13256  /* DMA only feeds source data to the CRC module. it does not write source data
13257  to the destination address. When a block transfer complete or pattern abort
13258  event occur, The DMA writes the CRC value to the destination address */
13261 // *****************************************************************************
13262 /* DMA channel CRC write order
13263  Summary:
13264  Identifies altering/maintaining write order post CRC computation.
13265  Description:
13266  This data type identifies write byte order selection post CRC
13267  computation.
13268  Remarks:
13269  None.
13270 */
13271 
13272 typedef
13273  enum
13274  {
13275  /* Source data is written to the destination unchanged regardless
13276  of the selected pre-CRC byte order. */
13278  /* Source data is written to the destination reordered according
13279  to the selected pre-CRC byte order. */
13282 // *****************************************************************************
13283 /* DMA channel operation modes
13284  Summary:
13285  Identifies the available DMA operating modes.
13286  Description:
13287  This data type Identifies the available DMA operating modes.
13288  The supported DMA modes are not mutually exclusive, but can be simultaneously
13289  operational.
13290  Remarks:
13291  These supported DMA modes can be logically OR'd together. They are passed
13292  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13293 */
13294 
13295 typedef
13296  enum
13297  {
13298  /* The normal DMA operation mode. The DMA channel will transfer data from
13299  a source to a destination without CPU intervention */
13300  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13301  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13302  ,
13303  /* Pattern Match abort mode allows the user to end a transfer if data
13304  written during a transaction matches a specific pattern, as defined by
13305  the DCHxDAT register */
13307  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13308  ,
13309  /* Channel chaining operating mode enhances the normal DMA channel
13310  operations. A channel(slave) can be chained to an adjacent channel(master).
13311  The slave channel will be enabled when a block transfer of the master
13312  channel completes. */
13313  /* only one of the below two chaining priorities must be provided.
13314  Chaining priority High. */
13316  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13317  ,
13318  /* Chaining priority Low */
13320  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13321  ,
13322  /* Auto enable operating mode allows a channel to be kept active, even if a
13323  block transfer completes or pattern match occurs. This prevents the user
13324  from having to re-enable the channel each time a block transfer completes. */
13325  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13326  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13327  ,
13328  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13329  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13330  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13332 // *****************************************************************************
13333 /* DMA channel CRC mode
13334  Summary:
13335  Defines the attributes for CRC operation mode.
13336  Description:
13337  This data type defines the attributes for CRC operation mode.
13338  Remarks:
13339  This feature may not be available on all devices. Refer to the specific device
13340  data sheet to determine availability.
13341 */
13342 
13343 typedef
13344  struct
13345  {
13346  /* CRC type (PLIB-level).
13347  Type Selection identifies whether the CRC module will calculate an IP
13348  header checksum or an LFSR CRC */
13349  DMA_CRC_TYPE type ;
13350  /* CRC mode, Background or Append */
13352  /* Polynomial length, This value is redundant when the selected CRC type is
13353  IP header checksum. When the CRC type is LFSR, Identifies the length of
13354  the polynomial. */
13355  uint8_t polyLength ;
13356  /* Bit order (PLIB-level).
13357  Identifies whether the CRC is computed LSb or MSb first */
13358  DMA_CRC_BIT_ORDER bitOrder ;
13359  /* Byte order (PLIB-level).
13360  Identifies the byte selection order input pre-CRC Generator. */
13361  DMA_CRC_BYTE_ORDER byteOrder ;
13362  /* Post CRC Write order */
13363  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13364  /* CRC data feed: While enabling the CRC mode, this field gives
13365  the seed for the CRC computation. On block transfer complete or
13366  pattern match abort the field have the computed CRC. */
13367  uint32_t data ;
13368  /* XOR bit mask, This value is redundant when the selected CRC type is
13369  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13370  bit mask input to the shift register during CRC computation. */
13371  uint32_t xorBitMask ;
13373 // *****************************************************************************
13374 /* DMA System service Events
13375  Summary:
13376  Enumeration of possible DMA System service events.
13377  Description:
13378  This data type provides an enumeration of all possible DMA System service events.
13379  Remarks:
13380  None.
13381 */
13382 
13383 typedef
13384  enum
13385  {
13386  /* Data was transferred successfully. */
13388  /* Error while processing the request */
13390  /* Data transfer was aborted. */
13392  /* No events yet. */
13395 // *****************************************************************************
13396 /* DMA System service Error
13397  Summary:
13398  Indicates the error information for the DMA System service.
13399  Description:
13400  This enumeration indicates the error information for the DMA System service.
13401  Remarks:
13402  None.
13403 */
13404 
13405 typedef
13406  enum
13407  {
13408  /* Data was transferred successfully. */
13409  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13410  = 1 << 0 ,
13411  /* DOM-IGNORE-END*/
13412  /* DMA address error. */
13413  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13414  = 1 << 1 /* DOM-IGNORE-END*/
13415  } SYS_DMA_ERROR ;
13416 // *****************************************************************************
13417 /* DMA Initialization data
13418  Summary:
13419  Defines the data required to initialize the DMA subsystem.
13420  Description:
13421  This data type defines the data required to initialize the DMA subsystem.
13422  Remarks:
13423  This feature may not be available on all devices. Refer to the specific device
13424  data sheet to determine availability.
13425 */
13426 
13427 typedef
13428  struct
13429  {
13430  /* Enable/Disable stop in idle mode feature */
13431  SYS_DMA_SIDL sidl ;
13432  } SYS_DMA_INIT ;
13433 // *****************************************************************************
13434 /* Data width options */
13435 
13436 typedef
13437  enum
13438  {
13439  /* Data width configuration feature is not available */
13441  } SYS_DMA_DATA_WIDTH ;
13442 // *****************************************************************************
13443 /* DMA descriptor control
13444  Summary:
13445  Defines the descriptor control for linked list operation.
13446  Description:
13447  This data type defines the descriptor control for linked list operation.
13448  Remarks:
13449  This feature may not be available on all devices. Refer to the specific device
13450  data sheet to determine availability.
13451 */
13452 
13453 typedef
13454  union
13455  {
13456  /* Feature is not supported */
13457  ;
13459 // *****************************************************************************
13460 // *****************************************************************************
13461 // Section: Initialization and Task Functions
13462 // *****************************************************************************
13463 // *****************************************************************************
13464 //******************************************************************************
13465 /* Function:
13466  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13467  Summary:
13468  Maintains the system service's state machine.
13469 
13470  Description:
13471  This function is used to maintain the DMA system service's internal state
13472  machine. This function services events on a specific DMA channel.
13473  Precondition:
13474  DMA should have been initialized by calling SYS_DMA_Initialize.
13475  Parameters:
13476  object - Object handle for the DMA module (returned from
13477  SYS_DMA_Initialize)
13478  activeChannel - DMA channel number to be serviced.
13479  Returns:
13480  None.
13481  Example:
13482  <code>
13483  // 'object' Returned from SYS_DMA_Initialize
13484  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13485  {
13486  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13487  }
13488  </code>
13489  Remarks:
13490  This function is normally not called directly by an application. It is
13491  called by the system's task/interrupt routines.
13492  */
13493 
13494 void
13495  SYS_DMA_Tasks (
13496  SYS_MODULE_OBJ object ,
13497  DMA_CHANNEL activeChannel ) ;
13498 //******************************************************************************
13499 /* For backward compatibility */
13500 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13501  // #ifndef _SYS_DMA_DEFINITIONS_H
13502 /*******************************************************************************
13503  End of File
13504 */
13505 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13506 /* CLOSE_FILE Include File */
13507 
13508 // DOM-IGNORE-BEGIN
13509 // DOM-IGNORE-END
13510 // *****************************************************************************
13511 // *****************************************************************************
13512 // Section: DMA System Service Interface Routines
13513 // *****************************************************************************
13514 // *****************************************************************************
13515 // *****************************************************************************
13516 /* DMA System service Transfer Event Handler Function
13517  Summary:
13518  Pointer to a DMA System service Transfer Event handler function.
13519  Description:
13520  This data type defines a DMA System service Transfer Event Handler Function.
13521  A DMA system service client must register an transfer event handler function of
13522  this type to receive transfer related events from the system service.
13523  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13524  was transferred successfully. The channelHandle parameter contains the channel
13525  handle of the channel on which the transfer was processed.
13526  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13527  not transferred successfully. TThe channelHandle parameter contains the channel
13528  handle of the channel on which the transfer had failed.
13529  The contextHandle parameter contains the context handle that was provided by
13530  the client at the time of registering the event handler. This context handle
13531  can be anything that the client consider helpful or necessary to identify
13532  the client context object associated with the channel of the system
13533  service that generated the event.
13534  The event handler function executes in an interrupt context when DMA is setup
13535  to start operation by an interrupt trigger source. It is recommended of the
13536  application to not perform process intensive operations with in this
13537  function.
13538  Remarks:
13539  None.
13540 */
13541 
13542 typedef
13544 SYS_DMA_CHANNEL_HANDLE handle ,
13545 uintptr_t contextHandle ) ;
13546 // *****************************************************************************
13547 // *****************************************************************************
13548 // Section: Initialization and Task Functions
13549 // *****************************************************************************
13550 // *****************************************************************************
13551 //******************************************************************************
13552 /* Function:
13553  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
13554  Summary:
13555  Initializes and Enables the DMA Controller.
13556  Description:
13557  This function Enables the DMA module. Enable/Disable stop in idle mode
13558  feature based on the passed parameter value.
13559  This function initializes the DMA module making it ready for clients to
13560  open and use it. The initialization data is specified by the init parameter.
13561  Precondition:
13562  None.
13563  Parameters:
13564  init - Pointer to the data structure containing any data
13565  necessary to initialize the hardware. This pointer may
13566  be null if no data is required and default
13567  initialization is to be used.
13568  Returns:
13569  If successful, returns a valid handle to the DMA module object.
13570  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
13571  Example:
13572  <code>
13573  SYS_MODULE_OBJ objectHandle;
13574  SYS_DMA_INIT initParam;
13575  initParam.sidl = SYS_DMA_SIDL_ENABLE;
13576  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
13577  (SYS_MODULE_INIT*)initParam);
13578  if (SYS_MODULE_OBJ_INVALID == objectHandle)
13579  {
13580  // Handle error
13581  }
13582  </code>
13583  Remarks:
13584  This function must be called before any other DMA systems service routines
13585  are called.
13586  Not all features are available on all micro-controllers.
13587 */
13588 
13589 SYS_MODULE_OBJ
13591  const SYS_MODULE_INIT * const init ) ;
13592 // *****************************************************************************
13593 // *****************************************************************************
13594 // Section: Channel Setup and management functions
13595 // *****************************************************************************
13596 // *****************************************************************************
13597 //******************************************************************************
13598 /* Function:
13599  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
13600  Summary:
13601  Allocates the specified DMA channel and returns a handle to it.
13602  Description:
13603  This function opens the specified DMA channel and provides a
13604  handle that must be provided to all other client-level operations to
13605  identify the caller and the DMA channel.
13606  Precondition:
13607  Function SYS_DMA_Initialize must have been called before calling this
13608  function.
13609  Parameters:
13610  channel - Channel number requested for allocation.
13611  When channel number specified is DMA_CHANNEL_ANY
13612  a random channel is allocated for DMA transfers.
13613  Returns:
13614  The channel handle for the requested channel number.
13615  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
13616  Error can occur.
13617  - if the requested channel number is invalid.
13618  - if the requested channel number is not free.
13619  Example:
13620  <code>
13621  DMA_CHANNEL channel;
13622  SYS_DMA_CHANNEL_HANDLE handle
13623  channel = DMA_CHANNEL_2;
13624  handle = SYS_DMA_ChannelAllocate(channel);
13625  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
13626  {
13627  // Failed to allocate the channel
13628  }
13629  else
13630  {
13631  // Proceed with setting up the channel and adding the transfer
13632  }
13633  </code>
13634  Remarks:
13635  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
13636  This function must be called before any other DMA channel Setup and management
13637  routines are called
13638 */
13639 
13642  DMA_CHANNEL channel ) ;
13643 //******************************************************************************
13644 /* Function:
13645  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
13646  Summary:
13647  Deallocates and frees the channel specified by the handle.
13648  Description:
13649  This function deallocates an allocated-channel of the DMA module,
13650  invalidating the handle.
13651  Precondition:
13652  DMA should have been initialized by calling SYS_DMA_Initialize.
13653  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
13654  Parameters:
13655  handle - A valid allocated-channel handle, returned from the service's
13656  Allocate routine
13657  Returns:
13658  None.
13659  Example:
13660  <code>
13661  DMA_CHANNEL channel;
13662  SYS_DMA_CHANNEL_HANDLE handle;
13663  channel = DMA_CHANNEL_2;
13664  handle = SYS_DMA_ChannelAllocate(channel);
13665  SYS_DMA_ChannelRelease(handle);
13666  </code>
13667  Remarks:
13668  After calling this routine, the handle passed in "handle" must not be used
13669  with any of the remaining service's routines. A new handle must be obtained by
13670  calling SYS_DMA_ChannelAllocate before the caller may use the service again
13671 */
13672 
13673 void
13675  SYS_DMA_CHANNEL_HANDLE handle ) ;
13676 //******************************************************************************
13677 /* Function:
13678  void SYS_DMA_ChannelSetup
13679  (
13680  SYS_DMA_CHANNEL_HANDLE handle,
13681  SYS_DMA_CHANNEL_OP_MODE modeEnable
13682  DMA_TRIGGER_SOURCE eventSrc
13683  )
13684  Summary:
13685  Setup the DMA channel parameters.
13686  Description:
13687  This function sets up the DMA channel parameters.
13688  It sets the channel priority and enables the mode of operations for the
13689  current system design.
13690  Precondition:
13691  DMA should have been initialized by calling SYS_DMA_Initialize.
13692  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13693  Parameters:
13694  handle - Handle of the DMA channel as returned by the
13695  SYS_DMA_ChannelAllocate function.
13696  priority - The priority to be associated to the channel.
13697  modeEnable - The supported operating modes to be enabled.
13698  This parameter can be logically ORed to specify
13699  multiple options.
13700  eventSrc - The event causing the cell transfer start.
13701  Returns:
13702  None.
13703  Example:
13704  <code>
13705  // 'handle' is a valid handle returned
13706  // by the SYS_DMA_ChannelAllocate function.
13707  SYS_DMA_CHANNEL_OP_MODE modeEnable;
13708  DMA_TRIGGER_SOURCE eventSrc;
13709  channel = DMA_CHANNEL_2;
13710  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
13711  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
13712  // Setup channel number, and enables basic and CRC mode
13713  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
13714  </code>
13715  Remarks:
13716  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
13717  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
13718  mode setup API's needs to be called to set the related parameters.
13719  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
13720  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
13721  Not all features are available on all microcontrollers.
13722  */
13723 
13724 void
13726  SYS_DMA_CHANNEL_HANDLE handle ,
13727  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
13728  DMA_TRIGGER_SOURCE eventSrc ) ;
13729 //******************************************************************************
13730 /* Function:
13731  void SYS_DMA_ChannelSetupMatchAbortMode
13732  (
13733  SYS_DMA_CHANNEL_HANDLE handle,
13734  uint16_t pattern,
13735  DMA_PATTERN_LENGTH length,
13736  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
13737  uint8_t ignorePattern
13738  )
13739  Summary:
13740  Setup the pattern match abort mode.
13741  Description:
13742  This function sets up the termination of DMA operation when the specified
13743  pattern is matched. Additionally on supported parts the function also
13744  sets up the ignoring of part of a pattern(8-bit) from match abort
13745  pattern(16-bit).
13746  Precondition:
13747  DMA should have been initialized by calling SYS_DMA_Initialize.
13748  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13749  The function SYS_DMA_ChannelSetup must be called to enable
13750  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
13751  match mode features.
13752  Parameters:
13753  handle - Handle of the DMA channel as returned by the
13754  SYS_DMA_ChannelAllocate function.
13755  pattern - The pattern that needs to be matched to abort a DMA transfer.
13756  length - Match pattern length can be 1-byte or 2-byte.
13757  ignore - Enable/Disable a byte between a 2-byte pattern match.
13758  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
13759  from the match abort pattern(16-bit)
13760  Returns:
13761  None.
13762  Example:
13763  <code>
13764  // Example 1
13765  // The following code is for a device with an 8-bit pattern value and no
13766  // support for pattern match ignore feature
13767  // 'handle' is a valid handle returned
13768  // by the SYS_DMA_ChannelAllocate function.
13769  uint16_t pattern;
13770  DMA_PATTERN_LENGTH length;
13771  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13772  uint8_t ignorePattern;
13773  pattern = 0x00; //Stop transfer on detection of a NULL character
13774  length = DMA_PATTERN_LENGTH_NONE;
13775  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
13776  ignorePattern = 0;
13777  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13778  ignoreEnable, ignorePattern);
13779  // Example 2
13780  // The following code is for a device with a 16-bit pattern value and
13781  // support for pattern match ignore feature
13782  // 'handle' is a valid handle returned
13783  // by the SYS_DMA_ChannelAllocate function.
13784  uint16_t pattern;
13785  DMA_PATTERN_LENGTH length;
13786  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13787  uint8_t ignorePattern;
13788  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
13789  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
13790  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
13791  ignorePattern = 0x00; \\ Any null character between the termination pattern
13792  \\ '\r' and '\n' is ignored.
13793  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13794  ignore, ignorePattern);
13795  </code>
13796  Remarks:
13797  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
13798  Not all features are available on all devices.
13799  Refer to the specific device data sheet for details.
13800 */
13801 
13802 void
13804  SYS_DMA_CHANNEL_HANDLE handle ,
13805  uint16_t pattern ,
13806  DMA_PATTERN_LENGTH length ,
13808  uint8_t ignorePattern ) ;
13809 //******************************************************************************
13810 /* Function:
13811  void SYS_DMA_ChannelCRCSet
13812  (
13813  SYS_DMA_CHANNEL_HANDLE handle,
13814  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
13815  )
13816  Summary:
13817  Sets up the CRC operation mode.
13818  Description:
13819  This function sets up the CRC computation features.
13820  Precondition:
13821  DMA should have been initialized by calling SYS_DMA_Initialize.
13822  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13823  The function SYS_DMA_ChannelSetup must be called to enable
13824  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13825  Parameters:
13826  handle - Handle of the DMA channel as returned by the
13827  SYS_DMA_ChannelAllocate function.
13828  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
13829  crc.mode - Compute the CRC in Background/Append mode.
13830  crc.polyLength - Denotes the length of the polynomial.
13831  crc.bitOrder - CRC is calculated LSb/MSb first.
13832  crc.byteOrder - Byte selection order input pre-CRC Generator
13833  crc.writeOrder - Write byte order selection post-CRC computation
13834  crc.data - Computed/Seed CRC
13835  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
13836  when mode is LFSR
13837  Returns:
13838  None.
13839  Example:
13840  <code>
13841  //Example 1
13842  // DMA calculation using the CRC background mode
13843  // 'handle' is a valid handle returned
13844  // by the SYS_DMA_ChannelAllocate function.
13845  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
13846  crc.type = DMA_CRC_LFSR;
13847  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
13848  crc.polyLength = 16;
13849  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
13850  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
13851  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
13852  crc.data = 0xFFFF;
13853  crc.xorBitMask = 0x1021;
13854  SYS_DMA_ChannelCRCSet(handle, crc);
13855  </code>
13856  Remarks:
13857  This feature may not be available on all devices. Refer to the specific device
13858  data sheet to determine availability.
13859 */
13860 
13861 void
13863  SYS_DMA_CHANNEL_HANDLE handle ,
13865 //******************************************************************************
13866 /* Function:
13867  uint32_t SYS_DMA_ChannelCRCGet(void)
13868  Summary:
13869  Returns the computed CRC.
13870  Description:
13871  This function returns the computed CRC
13872  Precondition:
13873  DMA should have been initialized by calling SYS_DMA_Initialize.
13874  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13875  The function SYS_DMA_ChannelSetup must be called to enable
13876  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13877  The CRC generator must have been previously setup using
13878  SYS_DMA_ChannelCRCSet.
13879  Parameters:
13880  None
13881  Returns:
13882  uint32_t - The Computed CRC.
13883  Example:
13884  <code>
13885  uint32_t computedCRC;
13886  computedCRC = SYS_DMA_ChannelCRCGet();
13887  </code>
13888  Remarks:
13889  To get the computed CRC value this function must be called after the block
13890  transfer completion event (i.e., after getting and processing the callback
13891  registered with SYS_DMA_ChannelTransferEventHandlerSet).
13892  This feature may not be available on all devices. Refer to the specific device
13893  data sheet to determine availability.
13894 */
13895 
13896 uint32_t
13897  SYS_DMA_ChannelCRCGet ( void ) ;
13898 //******************************************************************************
13899 /* Function:
13900  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
13901  Summary:
13902  Enables a channel.
13903  Description:
13904  This function enables a channel.
13905  Precondition:
13906  DMA should have been initialized by calling SYS_DMA_Initialize.
13907  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13908  The function SYS_DMA_ChannelSetup must have been called to setup and
13909  enable the required features.
13910  Parameters:
13911  handle - Handle of the DMA channel as returned by the
13912  SYS_DMA_ChannelAllocate function.
13913  Returns:
13914  None.
13915  Example:
13916  <code>
13917  // 'handle' is a valid handle returned
13918  // by the SYS_DMA_ChannelAllocate function.
13919  SYS_DMA_ChannelEnable(handle);
13920  </code>
13921  Remarks:
13922  This function may not required to be called when starting DMA setup
13923  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
13924  But may be needed to be called in the registered callback to enable the
13925  channel and continue the data transfer with the existing transfer parameters
13926  previously set with 'SYS_DMA_ChannelTransferAdd'.
13927  The DMA channel is by default disabled on the completion of block
13928  transfer(callback generated)
13929 */
13930 
13931 void
13933  SYS_DMA_CHANNEL_HANDLE handle ) ;
13934 //******************************************************************************
13935 /* Function:
13936  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
13937  Summary:
13938  Disables a channel.
13939  Description:
13940  This function disables a channel.
13941  Precondition:
13942  DMA should have been initialized by calling SYS_DMA_Initialize.
13943  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13944  The function SYS_DMA_ChannelSetup must have been called to setup and
13945  enable the required features.
13946  A DMA channel should have been enabled either by calling
13947  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
13948  Parameters:
13949  handle - Handle of the DMA channel as returned by the
13950  SYS_DMA_ChannelAllocate function.
13951  Returns:
13952  None.
13953  Example:
13954  <code>
13955  // 'handle' is a valid handle returned
13956  // by the SYS_DMA_ChannelAllocate function.
13957  SYS_DMA_ChannelDisable(handle);
13958  </code>
13959  Remarks:
13960  None.
13961 */
13962 
13963 void
13965  SYS_DMA_CHANNEL_HANDLE handle ) ;
13966 //******************************************************************************
13967 /* Function:
13968  void SYS_DMA_ChannelTransferAdd
13969  (
13970  SYS_DMA_CHANNEL_HANDLE handle,
13971  const void *srcAddr, size_t srcSize
13972  const void *destAddr, size_t destSize,
13973  size_t cellSize
13974  )
13975  Summary:
13976  Adds a data transfer to a DMA channel and Enables the channel to start
13977  data transfer.
13978  Description:
13979  This function adds a data transfer characteristics for a DMA channel. The
13980  The source and the destination addresses, source and destination lengths,
13981  The number of bytes transferred per cell event are set. It also enables
13982  the channel to start data transfer.
13983  If the requesting client registered an event callback with the service,
13984  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
13985  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
13986  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
13987  processed successfully.
13988  Precondition:
13989  DMA should have been initialized by calling SYS_DMA_Initialize.
13990  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13991  The function SYS_DMA_ChannelSetup must have been called to setup and
13992  enable the required features.
13993  Parameters:
13994  handle - Handle of the DMA channel as returned by the
13995  SYS_DMA_ChannelAllocate function.
13996  srcAddr - Source of the DMA transfer
13997  srcSize - Size of the source
13998  destAddr - Destination of the DMA transfer
13999  destSize - Size of the destination
14000  cellSize - Size of the cell
14001  Returns:
14002  None.
14003  Example:
14004  <code>
14005  // Add 10 bytes of data transfer to UART TX
14006  // 'handle' is a valid handle returned
14007  // by the SYS_DMA_ChannelAllocate function.
14008  MY_APP_OBJ myAppObj;
14009  uint8_t buf[10];
14010  void *srcAddr;
14011  void *destAddr;
14012  size_t srcSize;
14013  size_t destSize;
14014  size_t cellSize;
14015  srcAddr = (uint8_t *) buf;
14016  srcSize = 10;
14017  destAddr = (uin8_t*) &U2TXREG;
14018  destSize = 1;
14019  cellSize = 1;
14020  // User registers an event handler with system service. This is done once
14021  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14022  (uintptr_t)&myAppObj);
14023  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14024  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14025  {
14026  // Error handling here
14027  }
14028  // Event Processing Technique. Event is received when
14029  // the transfer is processed.
14030  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14031  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14032  {
14033  switch(event)
14034  {
14035  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14036  // This means the data was transferred.
14037  break;
14038  case SYS_DMA_TRANSFER_EVENT_ERROR:
14039  // Error handling here.
14040  break;
14041  default:
14042  break;
14043  }
14044  }
14045  </code>
14046  Remarks:
14047  For PIC32MZ series of devices, if the source/destination addresses are
14048  RAM memory addresses, the the source/destination buffers
14049  should be made coherent to avoid the cache coherency issues.
14050  For example:
14051  <code>
14052  uint8_t buffer[1024];
14053  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14054  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14055  </code>
14056 */
14057 
14058 void
14060  SYS_DMA_CHANNEL_HANDLE handle ,
14061  const void * srcAddr ,
14062  size_t srcSize ,
14063  const void * destAddr ,
14064  size_t destSize ,
14065  size_t cellSize ) ;
14066 //******************************************************************************
14067 /* Function:
14068  void SYS_DMA_ChannelTransferSet
14069  (
14070  SYS_DMA_CHANNEL_HANDLE handle,
14071  const void *srcAddr, size_t srcSize
14072  const void *destAddr, size_t destSize,
14073  size_t cellSize
14074  )
14075  Summary:
14076  Sets up a data transfer to a DMA channel.
14077  Description:
14078  This function sets up data transfer characteristics for a DMA channel. The
14079  The source and the destination addresses, source and destination lengths,
14080  The number of bytes transferred per cell event are set.
14081  This function does not enables the DMA channel. The channel has to be explicitly
14082  enabled to start the data transfer.
14083  The above functions could be used in situations where in the user intends to
14084  setup transfer parameters but do not intend to enable the channel immediately.
14085  For example to chain to DMA channels in a cyclic order where the channels remains
14086  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14087  condition occurs.
14088  Precondition:
14089  DMA should have been initialized by calling SYS_DMA_Initialize.
14090  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14091  The function SYS_DMA_ChannelSetup must have been called to setup and
14092  enable the required features.
14093  Parameters:
14094  handle - Handle of the DMA channel as returned by the
14095  SYS_DMA_ChannelAllocate function.
14096  srcAddr - Source of the DMA transfer
14097  srcSize - Size of the source
14098  destAddr - Destination of the DMA transfer
14099  destSize - Size of the destination
14100  cellSize - Size of the cell
14101  Returns:
14102  None.
14103  Example:
14104  <code>
14105  // Set up 10 bytes of data transfer to UART TX
14106  // 'handle' is a valid handle returned
14107  // by the SYS_DMA_ChannelAllocate function.
14108  MY_APP_OBJ myAppObj;
14109  uint8_t buf[10];
14110  void *srcAddr;
14111  void *destAddr;
14112  size_t srcSize;
14113  size_t destSize;
14114  size_t cellSize;
14115  srcAddr = (uint8_t *) buf;
14116  srcSize = 10;
14117  destAddr = (uin8_t*) &U2TXREG;
14118  destSize = 1;
14119  cellSize = 1;
14120  // User registers an event handler with system service. This is done once
14121  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14122  (uintptr_t)&myAppObj);
14123  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14124  SYS_DMA_ChannelEnable(handle);
14125  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14126  {
14127  // Error handling here
14128  }
14129  // Event Processing Technique. Event is received when
14130  // the transfer is processed.
14131  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14132  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14133  {
14134  switch(event)
14135  {
14136  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14137  // This means the data was transferred.
14138  break;
14139  case SYS_DMA_TRANSFER_EVENT_ERROR:
14140  // Error handling here.
14141  break;
14142  default:
14143  break;
14144  }
14145  }
14146  </code>
14147  Remarks:
14148  For PIC32MZ series of devices, if the source/destination addresses are
14149  RAM memory addresses, the the source/destination buffers
14150  should be made coherent to avoid the cache coherency issues.
14151  For example:
14152  <code>
14153  uint8_t buffer[1024];
14154  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14155  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14156  </code>
14157 */
14158 
14159 void
14161  SYS_DMA_CHANNEL_HANDLE handle ,
14162  const void * srcAddr ,
14163  size_t srcSize ,
14164  const void * destAddr ,
14165  size_t destSize ,
14166  size_t cellSize ) ;
14167 //******************************************************************************
14168 /* Function:
14169  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14170  Summary:
14171  Returns the number of bytes transferred from source.
14172  Description:
14173  When a data transfer request is submitted. At any time while the transmission
14174  is in progress the size of the amount of data transferred from source
14175  can be known by calling this function.
14176  Precondition:
14177  DMA should have been initialized by calling SYS_DMA_Initialize.
14178  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14179  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14180  SYS_DMA_ChannelTransferSet.
14181  Parameters:
14182  handle - A valid channel handle, returned from the system service's
14183  Allocate routine
14184  Returns:
14185  size_t - Returns the number of bytes transferred from the submitted size.
14186  Example:
14187  <code>
14188  // 'handle' is a valid handle returned
14189  // by the SYS_DMA_ChannelAllocate function.
14190  MY_APP_OBJ myAppObj;
14191  uint8_t buf[10];
14192  void *srcAddr;
14193  void *destAddr;
14194  size_t srcSize;
14195  size_t destSize;
14196  size_t cellSize;
14197  size_t transferredSize;
14198  srcAddr = (uint8_t *) buf;
14199  srcSize = 10;
14200  destAddr = (uin8_t*) &U2TXREG;
14201  destSize = 1;
14202  cellSize = 1;
14203  channelHandle = SYS_DMA_ChannelAllocate(channel);
14204  // User registers an event handler with system service. This is done once
14205  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14206  (uintptr_t)&myAppObj);
14207  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14208  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14209  {
14210  // Error handling here
14211  }
14212  // The data is being transferred after adding the transfer to the DMA channel.
14213  // The user can get to know dynamically the amount of data
14214  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14215  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14216  </code>
14217  Remarks:
14218  None.
14219 */
14220 
14221 size_t
14223  SYS_DMA_CHANNEL_HANDLE handle ) ;
14224 //******************************************************************************
14225 /* Function:
14226  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14227  Summary:
14228  Returns the number of bytes transferred to destination.
14229  Description:
14230  When a data transfer request is submitted. At any time while the transmission
14231  is in progress the size of the amount of data transferred to destination
14232  can be known by calling this function.
14233  Precondition:
14234  DMA should have been initialized by calling SYS_DMA_Initialize.
14235  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14236  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14237  SYS_DMA_ChannelTransferSet.
14238  Parameters:
14239  handle - A valid channel handle, returned from the system service's
14240  Allocate routine
14241  Returns:
14242  size_t - Returns the number of bytes received from the submitted size.
14243  Example:
14244  <code>
14245  // 'handle' is a valid handle returned
14246  // by the SYS_DMA_ChannelAllocate function.
14247  MY_APP_OBJ myAppObj;
14248  uint8_t buf[10];
14249  void *srcAddr;
14250  void *destAddr;
14251  size_t srcSize;
14252  size_t destSize;
14253  size_t cellSize;
14254  size_t transferredSize;
14255  srcAddr = (uin8_t*) &U2RXREG;
14256  srcSize = 1;
14257  destAddr = (uint8_t *) buf ;
14258  destSize = 10;
14259  cellSize = 1;
14260  channelHandle = SYS_DMA_ChannelAllocate(channel);
14261  // User registers an event handler with system service. This is done once
14262  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14263  (uintptr_t)&myAppObj);
14264  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14265  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14266  {
14267  // Error handling here
14268  }
14269  // The data is being transferred after adding the transfer to the DMA channel.
14270  // The user can get to know dynamically the amount of data
14271  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14272  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14273  </code>
14274  Remarks:
14275  None.
14276 */
14277 
14278 size_t
14280  SYS_DMA_CHANNEL_HANDLE handle ) ;
14281 //******************************************************************************
14282 /*
14283  Function:
14284  void SYS_DMA_ChannelTransferEventHandlerSet
14285  (
14286  SYS_DMA_CHANNEL_HANDLE handle,
14287  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14288  const uintptr_t contextHandle
14289  )
14290  Summary:
14291  This function allows a DMA system service client to set an event handler.
14292  Description:
14293  This function allows a client to set an event handler. The client may want
14294  to receive transfer related events in cases when it uses non-blocking read and
14295  write functions. The event handler should be set before the client
14296  intends to perform operations that could generate events.
14297  This function accepts a contextHandle parameter. This parameter could be
14298  set by the client to contain (or point to) any client specific data object
14299  that should be associated with this DMA channel.
14300  Precondition:
14301  DMA should have been initialized by calling SYS_DMA_Initialize.
14302  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14303  Parameters:
14304  handle - A valid channel handle, returned from the system service's
14305  Allocate routine
14306  eventHandler - Pointer to the event handler function.
14307  contextHandle - Value identifying the context of the application/driver/middleware
14308  that registered the event handling function.
14309  Returns:
14310  None.
14311  Example:
14312  <code>
14313  // 'handle' is a valid handle returned
14314  // by the SYS_DMA_ChannelAllocate function.
14315  MY_APP_OBJ myAppObj;
14316  uint8_t buf[10];
14317  void *srcAddr;
14318  void *destAddr;
14319  size_t srcSize;
14320  size_t destSize;
14321  size_t cellSize;
14322  srcAddr = (uint8_t *) buf;
14323  srcSize = 10;
14324  destAddr = (uin8_t*) &U2TXREG;
14325  destSize = 1;
14326  cellSize = 1;
14327  channelHandle = SYS_DMA_ChannelAllocate(channel);
14328  // User registers an event handler with system service. This is done once
14329  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14330  (uintptr_t)&myAppObj);
14331  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14332  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14333  {
14334  // Error handling here
14335  }
14336  // Event Processing Technique. Event is received when
14337  // the transfer is processed.
14338  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14339  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14340  {
14341  switch(event)
14342  {
14343  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14344  // This means the data was transferred.
14345  break;
14346  case SYS_DMA_TRANSFER_EVENT_ERROR:
14347  // Error handling here.
14348  break;
14349  default:
14350  break;
14351  }
14352  }
14353  </code>
14354  Remarks:
14355  None.
14356  */
14357 
14358 void
14360  SYS_DMA_CHANNEL_HANDLE handle ,
14361  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14362  const uintptr_t contextHandle ) ;
14363 // *****************************************************************************
14364 /* Function:
14365  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14366  Summary:
14367  This function returns the error(if any) associated with the last client
14368  request.
14369  Description:
14370  This function returns the error(if any) associated with the last client
14371  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14372  the client can call this function to know the error cause.
14373  The error status will be updated on every operation and should be read
14374  frequently (ideally immediately after the service operation has completed)
14375  to know the relevant error status.
14376  Precondition:
14377  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14378  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14379  handle.
14380  Parameters:
14381  handle - Handle of the DMA channel as returned by the
14382  SYS_DMA_ChannelAllocate function.
14383  Returns:
14384  A SYS_DMA_ERROR type indicating last known error status.
14385  Example:
14386  <code>
14387  // 'handle' is a valid handle returned
14388  // by the SYS_DMA_ChannelAllocate function.
14389  // pDmaSrc, pDmaDst is the source,destination address
14390  // txferSrcSize, txferDesSize is the source,destination transfer size
14391  // cellSize is the cell size
14392  MY_APP_OBJ myAppObj;
14393  // Client registers an event handler with service. This is done once
14394  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14395  (uintptr_t)&myAppObj );
14396  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14397  DMA_TRIGGER_SOURCE_NONE);
14398  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14399  pDmaDst,txferDesSize,cellSize);
14400  SYS_DMA_ChannelForceStart(handle);
14401  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14402  {
14403  // Error handling here
14404  }
14405  // Event Processing Technique. Event is received when
14406  // the transfer is processed.
14407  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14408  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14409  {
14410  switch(event)
14411  {
14412  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14413  // This means the data was transferred.
14414  break;
14415  case SYS_DMA_TRANSFER_EVENT_ERROR:
14416  // Error handling here.
14417  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14418  {
14419  // There was an address error.
14420  // Do error handling here.
14421  }
14422  break;
14423  default:
14424  break;
14425  }
14426  }
14427  </code>
14428  Remarks:
14429  It is the client's responsibility to make sure that the error status is
14430  obtained frequently. The service will update the error status
14431  regardless of whether this has been examined by the client.
14432 */
14433 
14436  SYS_DMA_CHANNEL_HANDLE handle ) ;
14437 //******************************************************************************
14438 /* Function:
14439  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14440  Summary:
14441  Force start of transfer on the selected channel.
14442  Description:
14443  The function force start a DMA transfer to occur for the selected channel.
14444  Precondition:
14445  DMA should have been initialized by calling SYS_DMA_Initialize.
14446  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14447  The function SYS_DMA_ChannelSetup must have been called to setup and
14448  enable the required features.
14449  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14450  Parameters:
14451  handle - Handle of the DMA channel as returned by the
14452  SYS_DMA_ChannelAllocate function.
14453  Returns:
14454  None.
14455  Example:
14456  <code>
14457  // 'handle' is a valid handle returned
14458  // by the SYS_DMA_ChannelAllocate function.
14459  // pDmaSrc, pDmaDst is the source,destination address
14460  // txferSrcSize, txferDesSize is the source,destination transfer size
14461  // cellSize is the cell size
14462  MY_APP_OBJ myAppObj;
14463  // Client registers an event handler with service. This is done once
14464  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14465  (uintptr_t)&myAppObj );
14466  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14467  DMA_TRIGGER_SOURCE_NONE);
14468  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14469  pDmaDst,txferDesSize,cellSize);
14470  SYS_DMA_ChannelForceStart(handle);
14471  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14472  {
14473  // Error handling here
14474  }
14475  // Event Processing Technique. Event is received when
14476  // the transfer is processed.
14477  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14478  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14479  {
14480  switch(event)
14481  {
14482  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14483  // This means the data was transferred.
14484  break;
14485  case SYS_DMA_TRANSFER_EVENT_ERROR:
14486  // Error handling here.
14487  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14488  {
14489  // There was an address error.
14490  // Do error handling here.
14491  }
14492  break;
14493  default:
14494  break;
14495  }
14496  }
14497  </code>
14498  Remarks:
14499  This function must be used to start the DMA transfer when the channel has been
14500  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14501 */
14502 
14503 void
14505  SYS_DMA_CHANNEL_HANDLE handle ) ;
14506 //******************************************************************************
14507 /* Function:
14508  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14509  Summary:
14510  Force abort of transfer on the selected channel.
14511  Description:
14512  The function aborts a DMA transfer to occur for the selected channel.
14513  Precondition:
14514  DMA should have been initialized by calling SYS_DMA_Initialize.
14515  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14516  The function SYS_DMA_ChannelSetup must have been called to setup and
14517  enable the required features.
14518  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14519  Parameters:
14520  handle - Handle of the DMA channel as returned by the
14521  SYS_DMA_ChannelAllocate function.
14522  Returns:
14523  None.
14524  Example:
14525  <code>
14526  // 'handle' is a valid handle returned
14527  // by the SYS_DMA_ChannelAllocate function.
14528  // pDmaSrc, pDmaDst is the source,destination address
14529  // txferSrcSize, txferDesSize is the source,destination transfer size
14530  // cellSize is the cell size
14531  MY_APP_OBJ myAppObj;
14532  // Client registers an event handler with service. This is done once
14533  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14534  (uintptr_t)&myAppObj );
14535  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14536  DMA_TRIGGER_SOURCE_NONE);
14537  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14538  pDmaDst,txferDesSize,cellSize);
14539  SYS_DMA_ChannelForceStart(handle);
14540  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14541  {
14542  // Error handling here
14543  }
14544  ....
14545  ....
14546  // Client may need to abort a transfer
14547  SYS_DMA_ChannelForceAbort(handle);
14548  // Event Processing Technique. Event is received when
14549  // the transfer is processed.
14550  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14551  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14552  {
14553  switch(event)
14554  {
14555  case SYS_DMA_TRANSFER_EVENT_ABORT:
14556  // This means the data was transferred.
14557  break;
14558  case SYS_DMA_TRANSFER_EVENT_ERROR:
14559  // Error handling here.
14560  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14561  {
14562  // There was an address error.
14563  // Do error handling here.
14564  }
14565  break;
14566  default:
14567  break;
14568  }
14569  }
14570  </code>
14571  Remarks:
14572  This function must be used to abort the DMA transfer when the channel has been
14573  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14574  and SYS_DMA_ChannelAbortEventSet has not been called.
14575 */
14576 
14577 void
14579  SYS_DMA_CHANNEL_HANDLE handle ) ;
14580 //******************************************************************************
14581 /* Function:
14582  void SYS_DMA_ChannelAbortEventSet
14583  (
14584  SYS_DMA_CHANNEL_HANDLE handle,
14585  DMA_TRIGGER_SOURCE eventSrc
14586  )
14587  Summary:
14588  Sets an event source and enables cell transfer abort event for the same
14589  for the selected channel.
14590  Description:
14591  This functions enables a cell transfer abort event for the selected source
14592  event.
14593  Precondition:
14594  DMA should have been initialized by calling SYS_DMA_Initialize.
14595  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14596  The function SYS_DMA_ChannelSetup must have been called to setup and
14597  enable the required features.
14598  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14599  Parameters:
14600  handle - Handle of the DMA channel as returned by the
14601  SYS_DMA_ChannelAllocate function.
14602  eventSrc - The event causing the cell transfer abort
14603  Returns:
14604  None.
14605  Example:
14606  <code>
14607  // 'handle' is a valid handle returned
14608  // by the SYS_DMA_ChannelAllocate function.
14609  // pDmaSrc, pDmaDst is the source,destination address
14610  // txferSrcSize, txferDesSize is the source,destination transfer size
14611  // cellSize is the cell size
14612  MY_APP_OBJ myAppObj;
14613  // Client registers an event handler with service. This is done once
14614  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14615  (uintptr_t)&myAppObj );
14616  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14617  DMA_TRIGGER_SOURCE_NONE);
14618  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14619  pDmaDst,txferDesSize,cellSize);
14620  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
14621  SYS_DMA_ChannelForceStart(handle);
14622  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14623  {
14624  // Error handling here
14625  }
14626  // Event Processing Technique. Event is received when
14627  // the transfer is processed.
14628  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14629  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14630  {
14631  switch(event)
14632  {
14633  case SYS_DMA_TRANSFER_EVENT_ABORT:
14634  // This means the data was transferred.
14635  break;
14636  case SYS_DMA_TRANSFER_EVENT_ERROR:
14637  // Error handling here.
14638  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14639  {
14640  // There was an address error.
14641  // Do error handling here.
14642  }
14643  break;
14644  default:
14645  break;
14646  }
14647  }
14648  </code>
14649  Remarks:
14650  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
14651  current DMA transfer will be aborted. The behavior is a same as calling
14652  SYS_DMA_ChannelForceAbort.
14653 */
14654 
14655 void
14657  SYS_DMA_CHANNEL_HANDLE handle ,
14658  DMA_TRIGGER_SOURCE eventSrc ) ;
14659 //******************************************************************************
14660 /* Function:
14661  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
14662  Summary:
14663  Returns the busy status of the specified DMA channel.
14664  Description:
14665  This function returns the busy status of the selected DMA channel
14666  Precondition:
14667  DMA should have been initialized by calling SYS_DMA_Initialize.
14668  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14669  Parameters:
14670  handle - Handle of the DMA channel as returned by the
14671  SYS_DMA_ChannelAllocate function.
14672  Returns:
14673  bool - true, if the selected DMA channel is active or enabled
14674  - false, if the selected DMA channel is inactive or disabled
14675  Example:
14676  <code>
14677  bool busyStat;
14678  busyStat = SYS_DMA_ChannelGetBusy(handle);
14679  </code>
14680  Remarks:
14681  This feature may not be available on all devices. Refer to the specific device
14682  data sheet to determine availability.
14683 */
14684 
14685 bool
14687  SYS_DMA_CHANNEL_HANDLE handle ) ;
14688 //******************************************************************************
14689 /* Function:
14690  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
14691  Summary:
14692  Suspend DMA operation on the specified DMA channel.
14693  Description:
14694  This function suspends the DMA operation on the DMA channel
14695  specified by the channel handle.
14696  Precondition:
14697  DMA should have been initialized by calling SYS_DMA_Initialize.
14698  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14699  Parameters:
14700  handle - Handle of the DMA channel as returned by the
14701  SYS_DMA_ChannelAllocate function.
14702  Returns:
14703  None.
14704  Example:
14705  <code>
14706  SYS_DMA_ChannelSuspend(handle);
14707  </code>
14708  Remarks:
14709  This feature may not be available on all devices. Refer to the specific device
14710  data sheet to determine availability.
14711 */
14712 
14713 void
14715  SYS_DMA_CHANNEL_HANDLE handle ) ;
14716 //******************************************************************************
14717 /* Function:
14718  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
14719  Summary:
14720  Resume DMA operation on the specified DMA channel.
14721  Description:
14722  This function resumes the DMA operation on the DMA channel
14723  specified by the channel handle.
14724  Precondition:
14725  DMA should have been initialized by calling SYS_DMA_Initialize.
14726  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14727  Parameters:
14728  handle - Handle of the DMA channel as returned by the
14729  SYS_DMA_ChannelAllocate function.
14730  Returns:
14731  None.
14732  Example:
14733  <code>
14734  SYS_DMA_ChannelResume(handle);
14735  </code>
14736  Remarks:
14737  This feature may not be available on all devices. Refer to the specific device
14738  data sheet to determine availability.
14739 */
14740 
14741 void
14743  SYS_DMA_CHANNEL_HANDLE handle ) ;
14744 // *****************************************************************************
14745 // *****************************************************************************
14746 // Section: Global DMA Management Functions
14747 // *****************************************************************************
14748 // *****************************************************************************
14749 //******************************************************************************
14750 /* Function:
14751  void SYS_DMA_Suspend(void)
14752  Summary:
14753  Suspend DMA transfers.
14754  Description:
14755  This function suspends DMA transfers to allow CPU uninterrupted access
14756  to data bus
14757  Precondition:
14758  DMA should have been initialized by calling SYS_DMA_Initialize.
14759  Parameters:
14760  None.
14761  Returns:
14762  None.
14763  Example:
14764  <code>
14765  SYS_DMA_Suspend();
14766  </code>
14767  Remarks:
14768  None
14769 */
14770 
14771 void
14772  SYS_DMA_Suspend ( void ) ;
14773 //******************************************************************************
14774 /* Function:
14775  void SYS_DMA_Resume(void)
14776  Summary:
14777  Resume DMA operations.
14778  Description:
14779  This function disables DMA suspend. It resumes the DMA operation suspended
14780  by calling SYS_DMA_Suspend. The DMA operates normally.
14781  Precondition:
14782  DMA should have been initialized by calling SYS_DMA_Initialize.
14783  Parameters:
14784  None.
14785  Returns:
14786  None.
14787  Example:
14788  <code>
14789  SYS_DMA_Resume();
14790  </code>
14791  Remarks:
14792  None
14793 */
14794 
14795 void
14796  SYS_DMA_Resume ( void ) ;
14797 //******************************************************************************
14798 /* Function:
14799  bool SYS_DMA_IsBusy(void)
14800  Summary:
14801  Returns the busy status of the DMA module.
14802  Description:
14803  This function returns the busy status of the DMA module
14804  Precondition:
14805  DMA should have been initialized by calling SYS_DMA_Initialize.
14806  Parameters:
14807  None.
14808  Returns:
14809  Boolean
14810  - true - The DMA module is active
14811  - false - The DMA module is inactive and disabled
14812  <code>
14813  bool busyStat;
14814  busyStat = SYS_DMA_IsBusy();
14815  </code>
14816  Remarks:
14817  This feature may not be available on all devices. Refer to the specific device
14818  data sheet to determine availability.
14819 */
14820 
14821 bool
14822  SYS_DMA_IsBusy ( void ) ;
14823 // *****************************************************************************
14824 // *****************************************************************************
14825 // Section: Deprecated functions
14826 // *****************************************************************************
14827 // *****************************************************************************
14828 //*******************************************************************************
14829 /* Function:
14830  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14831  Summary:
14832  This function is deprecated. Use SYS_DMA_Tasks function.
14833  */
14834 
14835 void
14836  SYS_DMA_Tasks (
14837  SYS_MODULE_OBJ object ,
14838  DMA_CHANNEL activeChannel ) ;
14839 //*****************************************************************************
14840 /* Function:
14841  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
14842  Summary:
14843  This function is deprecated. Use SYS_DMA_Tasks function.
14844  */
14845 
14846 void
14848  SYS_MODULE_OBJ object ) ;
14849 //*******************************************************************************
14850 /* Function:
14851  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14852  Summary:
14853  This function is deprecated. Use SYS_DMA_Tasks function.
14854  */
14855 
14856 void
14858  SYS_MODULE_OBJ object ,
14859  DMA_CHANNEL activeChannel ) ;
14860  // #ifndef _SYS_DMA_H
14861 /*******************************************************************************
14862  End of File
14863 */
14864 
14865 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
14866 /* CLOSE_FILE Include File */
14867 
14868 // DOM-IGNORE-BEGIN
14869 // DOM-IGNORE-END
14870 // *****************************************************************************
14871 // *****************************************************************************
14872 // Section: Data Types
14873 // *****************************************************************************
14874 // *****************************************************************************
14875 // *****************************************************************************
14876 /* Driver USART Module Index
14877  Summary:
14878  USART driver index definitions
14879  Description:
14880  These constants provide USART driver index definitions.
14881  Remarks:
14882  These constants should be used in place of hard-coded numeric literals.
14883  These values should be passed into the DRV_USART_Initialize and
14884  DRV_USART_Open routines to identify the driver instance in use.
14885 */
14886 #define DRV_USART_INDEX_0 0
14887 #define DRV_USART_INDEX_1 1
14888 #define DRV_USART_INDEX_2 2
14889 #define DRV_USART_INDEX_3 3
14890 #define DRV_USART_INDEX_4 4
14891 #define DRV_USART_INDEX_5 5
14892 // *****************************************************************************
14893 /* USART Driver Module Count
14894  Summary:
14895  Number of valid USART drivers
14896  Description:
14897  This constant identifies the maximum number of USART Driver instances that
14898  should be defined in the system. Defining more instances than this
14899  constant will waste RAM memory space.
14900  This constant can also be used by the system and application to identify the
14901  number of USART instances on this microcontroller.
14902  Remarks:
14903  This value is part-specific.
14904 */
14905 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
14906 // *****************************************************************************
14907 /* USART Driver Write Error
14908  Summary:
14909  USART Driver Write Error.
14910  Description:
14911  This constant is returned by DRV_USART_Write() function when an error
14912  occurs.
14913  Remarks:
14914  None.
14915 */
14916 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
14917 // *****************************************************************************
14918 /* USART Driver Read Error
14919  Summary:
14920  USART Driver Read Error.
14921  Description:
14922  This constant is returned by DRV_USART_Read() function when an error
14923  occurs.
14924  Remarks:
14925  None.
14926 */
14927 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
14928 // *****************************************************************************
14929 /* USART Driver Buffer Handle
14930  Summary:
14931  Handle identifying a read or write buffer passed to the driver.
14932  Description:
14933  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
14934  or DRV_USART_BufferAddWrite functions. This handle is associated with the
14935  buffer passed into the function and it allows the application to track the
14936  completion of the data from (or into) that buffer. The buffer handle value
14937  returned from the "buffer add" function is returned back to the client
14938  by the "event handler callback" function registered with the driver.
14939  The buffer handle assigned to a client request expires when the client has
14940  been notified of the completion of the buffer transfer (after event handler
14941  function that notifies the client returns) or after the buffer has been
14942  retired by the driver if no event handler callback was set.
14943  Remarks:
14944  None
14945 */
14946 
14947 typedef
14948 uintptr_t
14950 // *****************************************************************************
14951 /* USART Driver Invalid Buffer Handle
14952  Summary:
14953  Definition of an invalid buffer handle.
14954  Description:
14955  This is the definition of an invalid buffer handle. An invalid buffer handle
14956  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
14957  functions if the buffer add request was not successful.
14958  Remarks:
14959  None
14960 */
14961 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
14962 // *****************************************************************************
14963 /* USART Modes of Operation
14964  Summary:
14965  Identifies the modes of the operation of the USART module
14966  Description:
14967  This data type identifies the modes of the operation of the USART module.
14968  Remarks:
14969  Not all modes are available on all devices. Refer to the specific device data
14970  sheet to determine availability.
14971 */
14972 
14973 typedef
14974  enum
14975  {
14976  /* USART works in IRDA mode */
14978  /* This is the normal point to point communication mode where the USART
14979  communicates directly with another USART by connecting it's Transmit signal
14980  to the external USART's Receiver signal and vice versa. An external
14981  transceiver may be connected to obtain RS-232 signal levels. This type of
14982  connection is typically full duplex. */
14984  /* This is a multi-point bus mode where the USART can communicate with
14985  many other USARTS on a bus using an address-based protocol such as RS-485.
14986  This mode is typically half duplex and the physical layer may require a
14987  transceiver. In this mode every USART on the bus is assigned an address and
14988  the number of data bits is 9 bits */
14990  /* Loopback mode internally connects the Transmit signal to the Receiver
14991  signal, looping data transmission back into this USART's own input. It is
14992  useful primarily as a test mode. */
14995 // *****************************************************************************
14996 /* USART Driver Buffer Events
14997  Summary
14998  Identifies the possible events that can result from a buffer add request.
14999  Description
15000  This enumeration identifies the possible events that can result from a
15001  buffer add request caused by the client calling either the
15002  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
15003  Remarks:
15004  One of these values is passed in the "event" parameter of the event
15005  handling callback function that the client registered with the driver by
15006  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15007  transfer request is completed.
15008 */
15009 
15010 typedef
15011  enum
15012  {
15013  /* All data from or to the buffer was transferred successfully. */
15015  /* There was an error while processing the buffer transfer request. */
15017  /* Data transfer aborted (Applicable in DMA mode) */
15020 // *****************************************************************************
15021 /* USART Driver Buffer Result
15022  Summary
15023  Identifies the possible result of the buffer processing.
15024  Description
15025  This enumeration identifies the possible result of the buffer processing.
15026 
15027  Remarks:
15028  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15029  is in the free buffer pool.
15030 */
15031 
15032 typedef
15033  enum
15034  {
15035  /* Buffer handle is not valid*/
15037  /* Buffer handle has expired. */
15039  /* Buffer is removed from the queue succesfully*/
15041  /* Buffer removal failed because of unable to acquire the mutex
15042  * This is applicable in RTOS mode only */
15045 // *****************************************************************************
15046 /* USART Driver Buffer Event Handler Function Pointer
15047  Summary
15048  Pointer to a USART Driver Buffer Event handler function
15049  Description
15050  This data type defines the required function signature for the USART driver
15051  buffer event handling callback function. A client must register a pointer
15052  to a buffer event handling function whose function signature (parameter
15053  and return value types) match the types specified by this function pointer
15054  in order to receive buffer related event calls back from the driver.
15055  The parameters and return values and are described here and
15056  a partial example implementation is provided.
15057  Parameters:
15058  event - Identifies the type of event
15059  bufferHandle - Handle identifying the buffer to which the vent relates
15060  context - Value identifying the context of the application that registered
15061  the event handling function.
15062  Returns:
15063  None.
15064  Example:
15065  <code>
15066  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15067  DRV_USART_BUFFER_HANDLE bufferHandle,
15068  uintptr_t context )
15069  {
15070  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15071  switch(event)
15072  {
15073  case DRV_USART_BUFFER_EVENT_COMPLETE:
15074  // Handle the completed buffer.
15075  break;
15076  case DRV_USART_BUFFER_EVENT_ERROR:
15077  default:
15078  // Handle error.
15079  break;
15080  }
15081  }
15082  </code>
15083  Remarks:
15084  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15085  transferred successfully.
15086  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15087  transferred successfully. The DRV_USART_ErrorGet function can be called to
15088  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15089  called to find out how many bytes were processed.
15090  The bufferHandle parameter contains the buffer handle of the buffer that
15091  associated with the event.
15092  The context parameter contains the a handle to the client context,
15093  provided at the time the event handling function was registered using the
15094  DRV_USART_BufferEventHandlerSet function. This context handle value is
15095  passed back to the client as the "context" parameter. It can be any value
15096  necessary to identify the client context or instance (such as a pointer to
15097  the client's data) instance of the client that made the buffer add request.
15098  The event handler function executes in the driver peripheral's interrupt
15099  context when the driver is configured for interrupt mode operation. It is
15100  recommended of the application to not perform process intensive or blocking
15101  operations with in this function.
15102  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15103  be called in the event handler to add a buffer to the driver queue. These
15104  functions can only be called to add buffers to the driver whose event
15105  handler is running. For example, buffers cannot be added USART2 driver in
15106  USART1 driver event handler.
15107 */
15108 
15109 typedef
15111 DRV_USART_BUFFER_HANDLE bufferHandle ,
15112 uintptr_t context ) ;
15113 // *****************************************************************************
15114 /* USART Driver Byte Event Handler Function Pointer
15115  Summary
15116  Pointer to a USART Driver Byte Event handler function
15117  Description
15118  This data type defines the required function signature for the USART driver
15119  byte event handling callback function. A client must register a pointer to a
15120  byte event handling function whose function signature (parameter and return
15121  value types) match the types specified by this function pointer in order to
15122  receive byte related event calls back from the driver.
15123  Parameters:
15124  index - Identifier for the instance
15125  Returns:
15126  None.
15127  Example:
15128  <code>
15129  void APP_MyUsartTxEventHandler(void)
15130  {
15131  // Handle the transmit byte event
15132  }
15133  </code>
15134  Remarks:
15135  The event handler function executes in the driver peripheral's interrupt
15136  context when the driver is configured for interrupt mode operation. It is
15137  recommended that the application not perform process intensive or blocking
15138  operations with in this function.
15139 */
15140 
15141 typedef
15142 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15143 // *****************************************************************************
15144 /* USART Handshake Modes
15145  Summary:
15146  Identifies the handshaking modes supported by the USART driver.
15147  Description:
15148  This data type identifies the handshaking modes supported by the USART
15149  driver.
15150  Remarks:
15151  Not all modes are available on all devices. Refer to the specific device data
15152  sheet to determine availability.
15153 */
15154 
15155 typedef
15156  enum
15157  {
15158  /* Handshaking occurs in Flow Control Mode */
15159  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15160  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15161  ,
15162  /* Handshaking occurs in Simplex Mode */
15163  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15164  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15165  ,
15166  /* No Handshaking */
15167  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15168  2 /*DOM-IGNORE-END*/
15170 // *****************************************************************************
15171 /* USART Baud Set Result
15172  Summary:
15173  Identifies the results of the baud set function.
15174  Description:
15175  This data type identifies the results of the DRV_USART_BaudSet function.
15176  Remarks:
15177  None.
15178 */
15179 
15180 typedef
15181  enum
15182  {
15183  /* The driver was not able to change the baud */
15184  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15185  - 1 /*DOM-IGNORE-END*/
15186  ,
15187  /* The driver was able to change the baud successfully */
15190 // *****************************************************************************
15191 /* USART Line Control Set Result
15192  Summary:
15193  Identifies the results of the baud set function.
15194  Description:
15195  This data type identifies the results of the DRV_USART_LineControlSet
15196  function.
15197  Remarks:
15198  None.
15199 */
15200 
15201 typedef
15202  enum
15203  {
15204  /* The driver was not able to change the Line Control */
15205  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15206  - 1 /*DOM-IGNORE-END*/
15207  ,
15208  /* The driver was able to change the Line Control successfully */
15211 // *****************************************************************************
15212 /* USART Line Control Modes
15213  Summary:
15214  Identifies the line control modes supported by the USART driver.
15215  Description:
15216  This data type identifies the line control modes supported by the USART
15217  driver. Line control modes define the number of data bits, parity mode, and
15218  the number of stop bits in a USART transmit and receive frames.
15219  Remarks:
15220  The abbreviations used in the labels for the values of this enumeration
15221  follow the format <data><parity><stop>, where:
15222  <data> is the number of data bits
15223  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15224  added to obtain an even number of bits, or "ODD" for one bit
15225  added to obtain an odd number of bits.
15226  <stop> is the number of Stop bits
15227 */
15228 
15229 typedef
15230  enum
15231  {
15232  /* 8 data bits, no parity bit, 1 stop bit */
15233  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15234  USART_8N1 /* DOM-IGNORE-END*/
15235  ,
15236  /* 9 data bits, no parity bit, 1 stop bit */
15237  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15238  USART_9N1 /* DOM-IGNORE-END*/
15239  ,
15240  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15241  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15242  USART_8E1 /* DOM-IGNORE-END*/
15243  ,
15244  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15245  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15246  USART_8E2 /* DOM-IGNORE-END*/
15247  ,
15248  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15249  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15250  USART_8O1 /* DOM-IGNORE-END*/
15251  ,
15252  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15253  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15254  USART_8O2 /* DOM-IGNORE-END*/
15255  ,
15256  /* 8 data bits, no parity bit, 2 stop bit */
15257  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15258  USART_8N2 /* DOM-IGNORE-END*/
15259  ,
15260  /* 9 data bits, no parity bit, 2 stop bit */
15261  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15262  USART_9N2 /* DOM-IGNORE-END*/
15264 // *****************************************************************************
15265 /* USART Initialization flags
15266  Summary:
15267  Flags identifying features that can be enabled when the driver is
15268  initialized.
15269  Description:
15270  This enumeration defines flags identifying features that can be enabled
15271  when the driver is initialized.
15272  Remarks:
15273  These flags can be logically ORed together. They are passed into the
15274  DRV_USART_Initialize function through the "flags" member of the
15275  DRV_USART_INIT structure.
15276 */
15277 
15278 typedef
15279  enum
15280  {
15281  /* Use this if no flags need to be set */
15282  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15283  0 /*DOM-IGNORE-END*/
15284  ,
15285  /* Flag to enable "wake on start" operation. If supported and enabled,
15286  this feature will allow the USART to wake-up the device when a
15287  Start bit is received. This option should be selected only when the
15288  device is to placed in Sleep mode. Note that enabling this bit will
15289  also cause the first received character to be lost. Refer to the specific
15290  device data sheet for more information. */
15292  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15293  ,
15294  /* Flag to enable auto baud detection. If supported and enabled, this
15295  feature will allow the USART to automatically detect the baud rate in
15296  use. */
15297  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15298  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15299  ,
15300  /* Flag to enable stop in idle. If supported and enabled , this
15301  feature will allow the USART to stop when the CPU enters Idle
15302  mode */
15304  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15306 // *****************************************************************************
15307 /* Operation Mode Initialization Data
15308  Summary:
15309  Defines the initialization data required for different operation modes of
15310  USART.
15311  Description:
15312  This data type defines the initialization data required for different
15313  operation modes of the USART.
15314  Remarks:
15315  None
15316 */
15317 
15318 typedef
15319  union
15320  {
15321  /* Initialization for Addressed mode */
15322  struct
15323  {
15324  /* Address of the device. */
15325  uint8_t address ;
15326  } AddressedModeInit ;
15328 // *****************************************************************************
15329 /* USART Driver Errors.
15330  Summary:
15331  Defines the possible errors that can occur during driver operation.
15332  Description:
15333  This data type defines the possible errors that can occur when occur during
15334  USART driver operation. These values are returned by DRV_USART_ErrorGet
15335  function.
15336  Remarks:
15337  None
15338 */
15339 
15340 typedef
15341  enum
15342  {
15343  /* There was no error */
15345  /*DOM-IGNORE-BEGIN*/
15346  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15347  ,
15348  /* This indicates that a parity error has occurred */
15350  /*DOM-IGNORE-BEGIN*/
15351  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15352  ,
15353  /* This indicates that a framing error has occurred */
15355  /*DOM-IGNORE-BEGIN*/
15356  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15357  ,
15358  /* This indicates a receiver overflow has occurred */
15360  /*DOM-IGNORE-BEGIN*/
15361  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15362  ,
15363  /* Channel address error (Applicable in DMA mode) */
15364  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15365  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15366  } DRV_USART_ERROR ;
15367 // *****************************************************************************
15368 /* USART Client-Specific Driver Status
15369  Summary:
15370  Defines the client-specific status of the USART driver.
15371  Description:
15372  This enumeration defines the client-specific status codes of the USART
15373  driver.
15374  Remarks:
15375  Returned by the DRV_USART_ClientStatus function.
15376 */
15377 
15378 typedef
15379  enum
15380  {
15381  /* An error has occurred.*/
15383  /* The driver is closed, no operations for this client are ongoing,
15384  and/or the given handle is invalid. */
15386  /* The driver is currently busy and cannot start additional operations. */
15388  /* The module is running and ready for additional operations */
15391 // *****************************************************************************
15392 /* USART Driver Transfer Flags
15393  Summary
15394  Specifies the status of the receive or transmit
15395  Description
15396  This type specifies the status of the receive or transmit operation.
15397  Remarks:
15398  More than one of these values may be OR'd together to create a complete
15399  status value. To test a value of this type, the bit of interest must be
15400  ANDed with the value and checked to see if the result is non-zero.
15401 */
15402 
15403 typedef
15404  enum
15405  {
15406  /* Indicates that at least one byte of Data has been received */
15408  /*DOM-IGNORE-BEGIN*/
15409  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15410  ,
15411  /* Indicates that the core driver receiver buffer is empty */
15413  /*DOM-IGNORE-BEGIN*/
15414  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15415  ,
15416  /* Indicates that the core driver transmitter buffer is full */
15418  /*DOM-IGNORE-BEGIN*/
15419  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15420  ,
15421  /* Indicates that the core driver transmitter buffer is empty */
15423  /*DOM-IGNORE-BEGIN*/
15424  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15426 // *****************************************************************************
15427 /* USART Driver Initialization Data
15428  Summary:
15429  Defines the data required to initialize or reinitialize the USART driver
15430  Description:
15431  This data type defines the data required to initialize or reinitialize the
15432  USART driver. If the driver is built statically, the members of this data
15433  structure are statically over-ridden by static override definitions in the
15434  system_config.h file.
15435  Remarks:
15436  None.
15437 */
15438 
15439 typedef
15440  struct
15441  {
15442  /* System module initialization data */
15443  SYS_MODULE_INIT moduleInit ;
15444  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15445  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15446  system_config.h header file. */
15447  USART_MODULE_ID usartID ;
15448  /* Identifies the Operation mode of the USART driver. For a static build of
15449  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15450  system_config.h header file. */
15452  /* Data required by the operation mode of the driver. For a static build of
15453  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15454  system_config.h header file. */
15456  /* Flags to enable specific features. Refer to the
15457  description of DRV_USART_INIT_FLAGS for more details. For a static build
15458  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15459  system_config.h header file. */
15460  DRV_USART_INIT_FLAGS flags ;
15461  /* USART module Baud Rate Generator Clock. This typically
15462  the peripheral bus clock frequency. For a static build of the driver,
15463  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15464  header file. */
15465  uint32_t brgClock ;
15466  /* The initial USART line control settings. For a static build of the driver
15467  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15468  system_config.h header file. */
15469  DRV_USART_LINE_CONTROL lineControl ;
15470  /* Baud Rate value to be used, if not using auto baud. For a static build of
15471  the driver, this is overridden by the DRV_USART_BAUD macro in the
15472  system_config.h header file. */
15473  uint32_t baud ;
15474  /* Handshaking mode. For a static build of the driver, this is overridden by
15475  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15476  DRV_USART_HANDSHAKE handshake ;
15477  /* Lines enabled for the USART operation. For a static build of the driver,
15478  this is overridden by the DRV_USART_LINES_ENABLE macro in
15479  the system_config.h header file.
15480  For PPS parts, pin selection in ports overrides this. */
15481  USART_OPERATION_MODE linesEnable ;
15482  /* Interrupt source ID for the transmitter interrupt. For a static build of
15483  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15484  macro in the system_config.h header. */
15485  INT_SOURCE interruptTransmit ;
15486  /* Interrupt source ID for the receiver interrupt. For a static build of
15487  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15488  macro in the system_config.h header. */
15489  INT_SOURCE interruptReceive ;
15490  /* Interrupt source ID for the error Interrupt. For a static build of the
15491  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15492  in the system_config.h header. */
15493  INT_SOURCE interruptError ;
15494  /* This is the receive buffer queue size. This is the maximum
15495  number of read requests that driver will queue. For a
15496  static build of the driver, this is overridden by the
15497  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15498  unsigned int queueSizeReceive ;
15499  /* This is the transmit buffer queue size. This is the maximum
15500  number of write requests that driver will queue. For a
15501  static build of the driver, this is overridden by the
15502  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15503  unsigned int queueSizeTransmit ;
15504  /* This is the USART transmit DMA channel.
15505  For a static build of the driver, this is overridden by the
15506  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15507  DMA_CHANNEL dmaChannelTransmit ;
15508  /* This is the USART receive DMA channel.
15509  For a static build of the driver, this is overridden by the
15510  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15511  DMA_CHANNEL dmaChannelReceive ;
15512  /* This is the USART transmit DMA channel interrupt.
15513  For a static build of the driver, this is overridden by the
15514  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15515  INT_SOURCE dmaInterruptTransmit ;
15516  /* This is the USART receive DMA channel interrupt.
15517  For a static build of the driver, this is overridden by the
15518  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15519  INT_SOURCE dmaInterruptReceive ;
15520  } DRV_USART_INIT ;
15521 //DOM-IGNORE-BEGIN
15522 //DOM-IGNORE-END
15523  // #ifndef _DRV_USART_DEFINITIONS_H
15524 /*******************************************************************************
15525  End of File
15526 */
15527 
15528 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15529 /* CLOSE_FILE Include File */
15530 
15531 // DOM-IGNORE-BEGIN
15532 // DOM-IGNORE-END
15533 // *****************************************************************************
15534 // *****************************************************************************
15535 // Section: USART Driver Module Interface Routines
15536 // *****************************************************************************
15537 // *****************************************************************************
15538 // *****************************************************************************
15539 /* Function:
15540  SYS_MODULE_OBJ DRV_USART_Initialize
15541  (
15542  const SYS_MODULE_INDEX index,
15543  const SYS_MODULE_INIT * const init
15544  )
15545  Summary:
15546  Initializes the USART instance for the specified driver index.
15547  <p><b>Implementation:</b> Static/Dynamic</p>
15548  Description:
15549  This routine initializes the USART driver instance for the specified driver
15550  index, making it ready for clients to open and use it. The initialization
15551  data is specified by the init parameter. The initialization may fail if the
15552  number of driver objects allocated are insufficient or if the specified
15553  driver instance is already initialized. The driver instance index is
15554  independent of the USART module ID. For example, driver instance 0 can be
15555  assigned to USART2. If the driver is built statically, then some of the
15556  initialization parameters are overridden by configuration macros. Refer to
15557  the description of the DRV_USART_INIT data structure for more details on
15558  which members on this data structure are overridden.
15559  Precondition:
15560  None.
15561  Parameters:
15562  index - Identifier for the instance to be initialized
15563  init - Pointer to a data structure containing any data necessary to
15564  initialize the driver.
15565  Returns:
15566  If successful, returns a valid handle to a driver instance object.
15567  Otherwise, returns SYS_MODULE_OBJ_INVALID.
15568  Example:
15569  <code>
15570  // The following code snippet shows an example USART driver initialization.
15571  // The driver is initialized for normal mode and a baud of 300. The
15572  // receive queue size is set to 2 and transmit queue size is set to 3.
15573  DRV_USART_INIT usartInit;
15574  SYS_MODULE_OBJ objectHandle;
15575  usartInit.baud = 300;
15576  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
15577  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
15578  usartInit.usartID = USART_ID_2;
15579  usartInit.brgClock = 80000000;
15580  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
15581  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
15582  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
15583  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
15584  usartInit.queueSizeReceive = 2;
15585  usartInit.queueSizeTransmit = 3;
15586  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
15587  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
15588  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
15589  if (SYS_MODULE_OBJ_INVALID == objectHandle)
15590  {
15591  // Handle error
15592  }
15593  </code>
15594  Remarks:
15595  This routine must be called before any other USART routine is called.
15596  This routine should only be called once during system initialization
15597  unless DRV_USART_Deinitialize is called to deinitialize the driver
15598  instance. This routine will NEVER block for hardware access.
15599 */
15600 
15601 SYS_MODULE_OBJ
15603  const SYS_MODULE_INDEX index ,
15604  const SYS_MODULE_INIT * const init ) ;
15605 // *****************************************************************************
15606 /* Function:
15607  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
15608  Summary:
15609  Deinitializes the specified instance of the USART driver module.
15610  <p><b>Implementation:</b> Static/Dynamic</p>
15611  Description:
15612  Deinitializes the specified instance of the USART driver module, disabling
15613  its operation (and any hardware). Invalidates all the internal data.
15614  Precondition:
15615  Function DRV_USART_Initialize should have been called before calling this
15616  function.
15617  Parameters:
15618  object - Driver object handle, returned from the
15619  DRV_USART_Initialize routine
15620  Returns:
15621  None.
15622  Example:
15623  <code>
15624  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15625  SYS_STATUS status;
15626  DRV_USART_Deinitialize(object);
15627  status = DRV_USART_Status(object);
15628  if (SYS_MODULE_DEINITIALIZED != status)
15629  {
15630  // Check again later if you need to know
15631  // when the driver is deinitialized.
15632  }
15633  </code>
15634  Remarks:
15635  Once the Initialize operation has been called, the Deinitialize operation
15636  must be called before the Initialize operation can be called again. This
15637  routine will NEVER block waiting for hardware.
15638 */
15639 
15640 void
15642  SYS_MODULE_OBJ object ) ;
15643 // *****************************************************************************
15644 /* Function:
15645  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
15646  Summary:
15647  Gets the current status of the USART driver module.
15648  <p><b>Implementation:</b> Static/Dynamic</p>
15649  Description:
15650  This routine provides the current status of the USART driver module.
15651  Precondition:
15652  Function DRV_USART_Initialize should have been called before calling this
15653  function.
15654  Parameters:
15655  object - Driver object handle, returned from the
15656  DRV_USART_Initialize routine
15657  Returns:
15658  SYS_STATUS_READY - Indicates that the driver is busy with a
15659  previous system level operation and cannot start
15660  another
15661  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
15662  deinitialized
15663  Example:
15664  <code>
15665  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15666  SYS_STATUS usartStatus;
15667  usartStatus = DRV_USART _Status(object);
15668  if (SYS_STATUS_READY == usartStatus)
15669  {
15670  // This means the driver can be opened using the
15671  // DRV_USART_Open() function.
15672  }
15673  </code>
15674  Remarks:
15675  A driver can opened only when its status is SYS_STATUS_READY.
15676 */
15677 
15678 SYS_STATUS
15680  SYS_MODULE_OBJ object ) ;
15681 // *****************************************************************************
15682 /* Function:
15683  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
15684  Summary:
15685  Maintains the driver's transmit state machine and implements its ISR.
15686  <p><b>Implementation:</b> Static/Dynamic</p>
15687  Description:
15688  This routine is used to maintain the driver's internal transmit state
15689  machine and implement its transmit ISR for interrupt-driven implementations.
15690  In polling mode, this function should be called from the SYS_Tasks
15691  function. In interrupt mode, this function should be called in the transmit
15692  interrupt service routine of the USART that is associated with this USART
15693  driver hardware instance.
15694  Precondition:
15695  The DRV_USART_Initialize routine must have been called for the specified
15696  USART driver instance.
15697  Parameters:
15698  object - Object handle for the specified driver instance (returned from
15699  DRV_USART_Initialize)
15700  Returns:
15701  None.
15702  Example:
15703  <code>
15704  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15705  while (true)
15706  {
15707  DRV_USART_TasksTransmit (object);
15708  // Do other tasks
15709  }
15710  </code>
15711  Remarks:
15712  This routine is normally not called directly by an application. It is
15713  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15714  ISR.
15715  This routine may execute in an ISR context and will never block or access any
15716  resources that may cause it to block.
15717 */
15718 
15719 void
15721  SYS_MODULE_OBJ object ) ;
15722 // *****************************************************************************
15723 /* Function:
15724  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
15725  Summary:
15726  Maintains the driver's receive state machine and implements its ISR.
15727  <p><b>Implementation:</b> Static/Dynamic</p>
15728  Description:
15729  This routine is used to maintain the driver's internal receive state machine
15730  and implement its receive ISR for interrupt-driven implementations. In
15731  polling mode, this function should be called from the SYS_Tasks function.
15732  In interrupt mode, this function should be called in the receive interrupt
15733  service routine of the USART that is associated with this USART driver
15734  hardware instance.
15735  Precondition:
15736  The DRV_USART_Initialize routine must have been called for the specified
15737  USART driver instance.
15738  Parameters:
15739  object - Object handle for the specified driver instance (returned from
15740  DRV_USART_Initialize)
15741  Returns:
15742  None.
15743  Example:
15744  <code>
15745  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15746  while (true)
15747  {
15748  DRV_USART_TasksReceive (object);
15749  // Do other tasks
15750  }
15751  </code>
15752  Remarks:
15753  This routine is normally not called directly by an application. It is
15754  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15755  ISR.
15756  This routine may execute in an ISR context and will never block or access any
15757  resources that may cause it to block.
15758 */
15759 
15760 void
15762  SYS_MODULE_OBJ object ) ;
15763 // *****************************************************************************
15764 /* Function:
15765  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
15766  Summary:
15767  Maintains the driver's error state machine and implements its ISR.
15768  <p><b>Implementation:</b> Static/Dynamic</p>
15769  Description:
15770  This routine is used to maintain the driver's internal error state machine
15771  and implement its error ISR for interrupt-driven implementations. In
15772  polling mode, this function should be called from the SYS_Tasks function.
15773  In interrupt mode, this function should be called in the error interrupt
15774  service routine of the USART that is associated with this USART driver
15775  hardware instance.
15776  Precondition:
15777  The DRV_USART_Initialize routine must have been called for the specified
15778  USART driver instance.
15779  Parameters:
15780  object - Object handle for the specified driver instance (returned from
15781  DRV_USART_Initialize)
15782  Returns:
15783  None.
15784  Example:
15785  <code>
15786  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15787  while (true)
15788  {
15789  DRV_USART_TasksError (object);
15790  // Do other tasks
15791  }
15792  </code>
15793  Remarks:
15794  This routine is normally not called directly by an application. It is
15795  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15796  ISR.
15797  This routine may execute in an ISR context and will never block or access any
15798  resources that may cause it to block.
15799 */
15800 
15801 void
15803  SYS_MODULE_OBJ object ) ;
15804 // *****************************************************************************
15805 // *****************************************************************************
15806 // Section: USART Driver Client Routines
15807 // *****************************************************************************
15808 // *****************************************************************************
15809 // *****************************************************************************
15810 /* Function:
15811  DRV_HANDLE DRV_USART_Open
15812  (
15813  const SYS_MODULE_INDEX index,
15814  const DRV_IO_INTENT ioIntent
15815  )
15816  Summary:
15817  Opens the specified USART driver instance and returns a handle to it.
15818  <p><b>Implementation:</b> Static/Dynamic</p>
15819  Description:
15820  This routine opens the specified USART driver instance and provides a
15821  handle that must be provided to all other client-level operations to
15822  identify the caller and the instance of the driver. The ioIntent
15823  parameter defines how the client interacts with this driver instance.
15824  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
15825  additionally affect the behavior of the DRV_USART_Read and
15826  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
15827  then these function will not block even if the required amount of data could
15828  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
15829  will block until the required amount of data is processed. If the driver is
15830  configured for polling and bare-metal operation, it will not support
15831  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
15832  non-blocking.
15833  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
15834  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
15835  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
15836  client will be able to do both, read and write.
15837  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
15838  exclusive access to this client. The driver cannot be opened by any
15839  other client.
15840  Precondition:
15841  Function DRV_USART_Initialize must have been called before calling this
15842  function.
15843  Parameters:
15844  index - Identifier for the object instance to be opened
15845  intent - Zero or more of the values from the enumeration
15846  DRV_IO_INTENT "ORed" together to indicate the intended use
15847  of the driver. See function description for details.
15848  Returns:
15849  If successful, the routine returns a valid open-instance handle (a number
15850  identifying both the caller and the module instance).
15851  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
15852  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
15853  insufficient.
15854  - if the client is trying to open the driver but driver has been opened
15855  exclusively by another client.
15856  - if the driver hardware instance being opened is not initialized or is
15857  invalid.
15858  - if the client is trying to open the driver exclusively, but has already
15859  been opened in a non exclusive mode by another client.
15860  - if the driver is not ready to be opened, typically when the initialize
15861  routine has not completed execution.
15862  Example:
15863  <code>
15864  DRV_HANDLE handle;
15865  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
15866  if (DRV_HANDLE_INVALID == handle)
15867  {
15868  // Unable to open the driver
15869  // May be the driver is not initialized or the initialization
15870  // is not complete.
15871  }
15872  </code>
15873  Remarks:
15874  The handle returned is valid until the DRV_USART_Close routine is called.
15875  This routine will NEVER block waiting for hardware.If the requested intent
15876  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
15877  function is thread safe in a RTOS application.
15878 */
15879 
15880 DRV_HANDLE
15881  DRV_USART_Open (
15882  const SYS_MODULE_INDEX index ,
15883  const DRV_IO_INTENT ioIntent ) ;
15884 // *****************************************************************************
15885 /* Function:
15886  void DRV_USART_Close( DRV_Handle handle )
15887  Summary:
15888  Closes an opened-instance of the USART driver.
15889  <p><b>Implementation:</b> Static/Dynamic</p>
15890  Description:
15891  This routine closes an opened-instance of the USART driver, invalidating the
15892  handle. Any buffers in the driver queue that were submitted by this client
15893  will be removed. After calling this routine, the handle passed in "handle"
15894  must not be used with any of the remaining driver routines (with one
15895  possible exception described in the "Remarks" section). A new handle must
15896  be obtained by calling DRV_USART_Open before the caller may use the driver
15897  again
15898  Precondition:
15899  The DRV_USART_Initialize routine must have been called for the specified
15900  USART driver instance.
15901  DRV_USART_Open must have been called to obtain a valid opened device handle.
15902  Parameters:
15903  handle - A valid open-instance handle, returned from the driver's
15904  open routine
15905  Returns:
15906  None.
15907  Example:
15908  <code>
15909  DRV_HANDLE handle; // Returned from DRV_USART_Open
15910  DRV_USART_Close(handle);
15911  // After this point, the handle cannot be used with any other function
15912  // except the DRV_USART_ClientStatus function, which can be used to query
15913  // the success status of the DRV_USART_Close function.
15914  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
15915  </code>
15916  Remarks:
15917  Usually there is no need for the client to verify that the Close operation
15918  has completed. The driver will abort any ongoing operations when this
15919  routine is called. However, if it requires additional time to do so in a
15920  non-blocking environment, it will still return from the Close operation but
15921  the handle is now a zombie handle. The client can only call the
15922  DRV_USART_ClientStatus on a zombie handle to track the completion of the
15923  Close operation. The DRV_USART_ClientStatus routine will return
15924  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
15925 */
15926 
15927 void
15928  DRV_USART_Close (
15929  const DRV_HANDLE handle ) ;
15930 // *****************************************************************************
15931 /*
15932  Function:
15933  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
15934  Summary:
15935  Gets the current client-specific status the USART driver.
15936  <p><b>Implementation:</b> Static/Dynamic</p>
15937  Description:
15938  This function gets the client-specific status of the USART driver associated
15939  with the given handle. This function can be used to check the status of
15940  client after the DRV_USART_Close() function has been called.
15941  Preconditions:
15942  The DRV_USART_Initialize function must have been called.
15943  DRV_USART_Open must have been called to obtain a valid opened device
15944  handle.
15945  Parameters:
15946  handle - Handle returned from the driver's open function.
15947  Returns:
15948  A DRV_USART_CLIENT_STATUS value describing the current status of the
15949  driver.
15950  Example:
15951  <code>
15952  DRV_HANDLE handle; // Returned from DRV_USART_Open
15953  DRV_USART_CLIENT_STATUS status;
15954  status = DRV_USART_ClientStatus(handle);
15955  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
15956  {
15957  // The client had not closed.
15958  }
15959  </code>
15960  Remarks:
15961  This function will not block for hardware access and will immediately return
15962  the current status. This function is thread safe when called in a RTOS
15963  application.
15964 */
15965 
15968  DRV_HANDLE handle ) ;
15969 // *****************************************************************************
15970 // *****************************************************************************
15971 // Section: USART Driver Buffer Queuing Model Interface Routines
15972 // *****************************************************************************
15973 // *****************************************************************************
15974 // *****************************************************************************
15975 /* Function:
15976  void DRV_USART_BufferAddWrite
15977  (
15978  const DRV_HANDLE handle,
15979  DRV_USART_BUFFER_HANDLE * bufferHandle,
15980  void * buffer,
15981  size_t size
15982  );
15983  Summary:
15984  Schedule a non-blocking driver write operation.
15985  <p><b>Implementation:</b> Static/Dynamic</p>
15986  Description:
15987  This function schedules a non-blocking write operation. The function returns
15988  with a valid buffer handle in the bufferHandle argument if the write request
15989  was scheduled successfully. The function adds the request to the hardware
15990  instance transmit queue and returns immediately. While the request is in the
15991  queue, the application buffer is owned by the driver and should not be
15992  modified. On returning, the bufferHandle parameter may be
15993  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
15994  - if a buffer could not be allocated to the request
15995  - if the input buffer pointer is NULL
15996  - if the client opened the driver for read-only
15997  - if the buffer size is 0
15998  - if the transmit queue is full or the queue depth is insufficient
15999  If the requesting client registered an event callback with the driver, the
16000  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16001  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16002  was not processed successfully.
16003  Precondition:
16004  The DRV_USART_Initialize routine must have been called for the specified
16005  USART device instance and the DRV_USART_Status must have returned
16006  SYS_STATUS_READY.
16007  DRV_USART_Open must have been called to obtain a valid opened device handle.
16008  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16009  the DRV_USART_Open call.
16010  Parameters:
16011  handle - Handle of the communication channel as return by the
16012  DRV_USART_Open function.
16013  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16014  buffer - Data to be transmitted.
16015  size - Buffer size in bytes.
16016  Returns:
16017  The bufferHandle parameter will contain the return buffer handle. This will be
16018  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16019  Example:
16020  <code>
16021  MY_APP_OBJ myAppObj;
16022  uint8_t mybuffer[MY_BUFFER_SIZE];
16023  DRV_USART_BUFFER_HANDLE bufferHandle;
16024  // myUSARTHandle is the handle returned
16025  // by the DRV_USART_Open function.
16026  // Client registers an event handler with driver
16027  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16028  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16029  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16030  myBuffer, MY_BUFFER_SIZE);
16031  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16032  {
16033  // Error handling here
16034  }
16035  // Event is received when
16036  // the buffer is processed.
16037  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16038  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16039  {
16040  // contextHandle points to myAppObj.
16041  switch(event)
16042  {
16043  case DRV_USART_BUFFER_EVENT_COMPLETE:
16044  // This means the data was transferred.
16045  break;
16046  case DRV_USART_BUFFER_EVENT_ERROR:
16047  // Error handling here.
16048  break;
16049  default:
16050  break;
16051  }
16052  }
16053  </code>
16054  Remarks:
16055  This function is thread safe in a RTOS application. It can be called from
16056  within the USART Driver Buffer Event Handler that is registered by this
16057  client. It should not be called in the event handler associated with another
16058  USART driver instance. It should not otherwise be called directly in an ISR.
16059 */
16060 
16061 void
16063  const DRV_HANDLE handle ,
16064  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16065  void * buffer ,
16066  const size_t size ) ;
16067 // *****************************************************************************
16068 /* Function:
16069  void DRV_USART_AddressedBufferAddWrite
16070  (
16071  const DRV_HANDLE hClient,
16072  DRV_USART_BUFFER_HANDLE * bufferHandle,
16073  uint8_t address,
16074  void * source,
16075  size_t nWords
16076  );
16077  Summary:
16078  Schedule a non-blocking addressed driver write operation.
16079  <p><b>Implementation:</b> Dynamic</p>
16080  Description:
16081  This function schedules a non-blocking addressed write operation. The function returns
16082  with a valid buffer handle in the bufferHandle argument if the addressed write request
16083  was scheduled successfully. The function adds the request to the hardware
16084  instance transmit queue and returns immediately. While the request is in the
16085  queue, the application buffer is owned by the driver and should not be
16086  modified. On returning, the bufferHandle parameter may be
16087  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16088  - if a buffer could not be allocated to the request
16089  - if the input buffer pointer is NULL
16090  - if the client opened the driver for read-only
16091  - if the buffer size is 0
16092  - if the transmit queue is full or the queue depth is insufficient
16093  If the requesting client registered an event callback with the driver, the
16094  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16095  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16096  was not processed successfully.
16097  Precondition:
16098  The DRV_USART_Initialize routine must have been called for the specified
16099  USART device instance and the DRV_USART_Status must have returned
16100  SYS_STATUS_READY.
16101  DRV_USART_Open must have been called to obtain a valid opened device handle.
16102  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16103  the DRV_USART_Open call.
16104  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16105  Parameters:
16106  hClient - Handle of the communication channel as return by the
16107  DRV_USART_Open function.
16108  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16109  address - Address of the receiver client
16110  source - Data to be transmitted.
16111  size - Buffer size in 16-bit words.
16112  Returns:
16113  The bufferHandle parameter will contain the return buffer handle. This will be
16114  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16115  Example:
16116  <code>
16117  MY_APP_OBJ myAppObj;
16118  uint16_t mybuffer[MY_BUFFER_SIZE];
16119  DRV_USART_BUFFER_HANDLE bufferHandle;
16120  uint8_t clientAddress;
16121  // myUSARTHandle is the handle returned
16122  // by the DRV_USART_Open function.
16123  // Client registers an event handler with driver
16124  clientAddress = 0x60;
16125  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16126  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16127  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16128  myBuffer, MY_BUFFER_SIZE);
16129  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16130  {
16131  // Error handling here
16132  }
16133  // Event is received when
16134  // the buffer is processed.
16135  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16136  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16137  {
16138  // contextHandle points to myAppObj.
16139  switch(event)
16140  {
16141  case DRV_USART_BUFFER_EVENT_COMPLETE:
16142  // This means the data was transferred.
16143  break;
16144  case DRV_USART_BUFFER_EVENT_ERROR:
16145  // Error handling here.
16146  break;
16147  default:
16148  break;
16149  }
16150  }
16151  </code>
16152  Remarks:
16153  This function is thread safe in a RTOS application. It can be called from
16154  within the USART Driver Buffer Event Handler that is registered by this
16155  client. It should not be called in the event handler associated with another
16156  USART driver instance. It should not otherwise be called directly in an ISR.
16157  The source buffer should be a 16-bit word aligned buffer.
16158  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16159 */
16160 
16161 void
16163  const DRV_HANDLE hClient ,
16164  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16165  uint8_t address ,
16166  void * source ,
16167  size_t nWords ) ;
16168 // *****************************************************************************
16169 /* Function:
16170  void DRV_USART_BufferAddRead
16171  (
16172  const DRV_HANDLE handle,
16173  DRV_USART_BUFFER_HANDLE * bufferHandle,
16174  void * buffer,
16175  const size_t size
16176  )
16177  Summary:
16178  Schedule a non-blocking driver read operation.
16179  <p><b>Implementation:</b> Static/Dynamic</p>
16180  Description:
16181  This function schedules a non-blocking read operation. The function returns
16182  with a valid buffer handle in the bufferHandle argument if the read request
16183  was scheduled successfully. The function adds the request to the hardware
16184  instance receive queue and returns immediately. While the request is in the
16185  queue, the application buffer is owned by the driver and should not be
16186  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16187  bufferHandle argument:
16188  - if a buffer could not be allocated to the request
16189  - if the input buffer pointer is NULL
16190  - if the buffer size is 0
16191  - if the read queue size is full or queue depth is insufficient.
16192  - if the driver handle is invalid
16193  If the requesting client registered an event callback with the driver, the
16194  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16195  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16196  was not processed successfully.
16197  Precondition:
16198  The DRV_USART_Initialize routine must have been called for the specified
16199  USART device instance and the DRV_USART_Status must have returned
16200  SYS_STATUS_READY.
16201  DRV_USART_Open must have been called to obtain a valid opened device handle.
16202  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16203  the DRV_USART_Open call.
16204  Parameters:
16205  handle - Handle of the communication channel as returned by the
16206  DRV_USART_Open function.
16207  buffer - Buffer where the received data will be stored.
16208  size - Buffer size in bytes.
16209  Returns:
16210  The buffer handle is returned in the bufferHandle argument. This is
16211  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16212  Example:
16213  <code>
16214  MY_APP_OBJ myAppObj;
16215  uint8_t mybuffer[MY_BUFFER_SIZE];
16216  DRV_USART_BUFFER_HANDLE bufferHandle;
16217  // myUSARTHandle is the handle returned
16218  // by the DRV_USART_Open function.
16219  // Client registers an event handler with driver
16220  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16221  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16222  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16223  myBuffer, MY_BUFFER_SIZE);
16224  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16225  {
16226  // Error handling here
16227  }
16228  // Event is received when
16229  // the buffer is processed.
16230  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16231  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16232  {
16233  // contextHandle points to myAppObj.
16234  switch(event)
16235  {
16236  case DRV_USART_BUFFER_EVENT_COMPLETE:
16237  // This means the data was transferred.
16238  break;
16239  case DRV_USART_BUFFER_EVENT_ERROR:
16240  // Error handling here.
16241  break;
16242  default:
16243  break;
16244  }
16245  }
16246  </code>
16247  Remarks:
16248  This function is thread safe in a RTOS application. It can be called from
16249  within the USART Driver Buffer Event Handler that is registered by the
16250  client. It should not be called in the event handler associated with another
16251  USART driver instance. It should not be called directly in an ISR.
16252 */
16253 
16254 void
16256  const DRV_HANDLE handle ,
16257  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16258  void * buffer ,
16259  const size_t size ) ;
16260 // *****************************************************************************
16261 /* Function:
16262  void DRV_USART_BufferEventHandlerSet
16263  (
16264  const DRV_HANDLE handle,
16265  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16266  const uintptr_t context
16267  )
16268  Summary:
16269  Allows a client to identify a buffer event handling function for the driver
16270  to call back when queued buffer transfers have finished.
16271  <p><b>Implementation:</b> Static/Dynamic</p>
16272  Description:
16273  This function allows a client to identify a buffer event handling function
16274  for the driver to call back when queued buffer transfers have finished.
16275  When a client calls either the DRV_USART_BufferAddRead or
16276  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16277  the buffer that was added to the driver's buffer queue. The driver will
16278  pass this handle back to the client by calling "eventHandler" function when
16279  the buffer transfer has completed.
16280  The event handler should be set before the client performs any "buffer add"
16281  operations that could generate events. The event handler once set, persists
16282  until the client closes the driver or sets another event handler (which
16283  could be a "NULL" pointer to indicate no callback).
16284  Precondition:
16285  The DRV_USART_Initialize routine must have been called for the specified
16286  USART driver instance.
16287  DRV_USART_Open must have been called to obtain a valid opened device handle.
16288  Parameters:
16289  handle - A valid open-instance handle, returned from the driver's
16290  open routine
16291  eventHandler - Pointer to the event handler function.
16292  context - The value of parameter will be passed back to the client
16293  unchanged, when the eventHandler function is called. It can
16294  be used to identify any client specific data object that
16295  identifies the instance of the client module (for example,
16296  it may be a pointer to the client module's state structure).
16297  Returns:
16298  None.
16299  Example:
16300  <code>
16301  // myAppObj is an application specific state data object.
16302  MY_APP_OBJ myAppObj;
16303  uint8_t mybuffer[MY_BUFFER_SIZE];
16304  DRV_USART_BUFFER_HANDLE bufferHandle;
16305  // myUSARTHandle is the handle returned
16306  // by the DRV_USART_Open function.
16307  // Client registers an event handler with driver. This is done once
16308  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16309  (uintptr_t)&myAppObj );
16310  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16311  myBuffer, MY_BUFFER_SIZE);
16312  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16313  {
16314  // Error handling here
16315  }
16316  // Event Processing Technique. Event is received when
16317  // the buffer is processed.
16318  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16319  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16320  {
16321  // The context handle was set to an application specific
16322  // object. It is now retrievable easily in the event handler.
16323  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16324  switch(event)
16325  {
16326  case DRV_USART_BUFFER_EVENT_COMPLETE:
16327  // This means the data was transferred.
16328  break;
16329  case DRV_USART_BUFFER_EVENT_ERROR:
16330  // Error handling here.
16331  break;
16332  default:
16333  break;
16334  }
16335  }
16336  </code>
16337  Remarks:
16338  If the client does not want to be notified when the queued buffer transfer
16339  has completed, it does not need to register a callback. This function is
16340  thread safe when called in a RTOS application.
16341 */
16342 
16343 void
16345  const DRV_HANDLE handle ,
16346  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16347  const uintptr_t context ) ;
16348 // *****************************************************************************
16349 /* Function:
16350  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16351  Summary:
16352  Removes a requested buffer from the queue.
16353  <p><b>Implementation:</b> Static/Dynamic</p>
16354  Description:
16355  This function removes a specified buffer from the queue.
16356  The client can use this function to delete
16357  1. An unwated stalled buffer.
16358  2. Queued buffers on timeout.
16359  or in any other use case.
16360  Precondition:
16361  The DRV_USART_Initialize routine must have been called for the specified
16362  USART driver instance.
16363  DRV_USART_Open must have been called to obtain a valid opened device handle.
16364  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16365  must have been called and a valid buffer handle returned.
16366  Parameters:
16367  bufferhandle - Handle of the buffer to delete.
16368  Returns:
16369  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16370  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16371  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16372  queue successfully.
16373  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16374  the queue because of mutex timeout in RTOS environment.
16375  Example:
16376  <code>
16377  // myAppObj is an application specific object.
16378  MY_APP_OBJ myAppObj;
16379  uint8_t mybuffer[MY_BUFFER_SIZE];
16380  DRV_USART_BUFFER_HANDLE bufferHandle;
16381  // myUSARTHandle is the handle returned
16382  // by the DRV_USART_Open function.
16383  // Client registers an event handler with driver. This is done once
16384  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16385  (uintptr_t)&myAppObj );
16386  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16387  myBuffer, MY_BUFFER_SIZE );
16388  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16389  {
16390  // Error handling here
16391  }
16392  // Event Processing Technique. Event is received when
16393  // the buffer is processed.
16394  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16395  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16396  {
16397  switch(event)
16398  {
16399  case DRV_USART_BUFFER_EVENT_COMPLETE:
16400  // This means the data was transferred.
16401  break;
16402  case DRV_USART_BUFFER_EVENT_ERROR:
16403  // Error handling here.
16404  break;
16405  default:
16406  break;
16407  }
16408  }
16409  // Timeout function, where remove queued buffer if it still exists.
16410  void APP_TimeOut(void)
16411  {
16412  DRV_USART_BUFFER_RESULT bufferResult;
16413  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16414  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16415  {
16416  //Buffer removed succesfully from the queue
16417  }
16418  else
16419  {
16420  //Either buffer is invalid or expired.
16421  //Or not able to acquire mutex in RTOS mode.
16422  }
16423  }
16424  </code>
16425  Remarks:
16426  This function is thread safe when used in a RTOS application.
16427 */
16428 
16431  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16432 // *****************************************************************************
16433 /* Function:
16434  size_t DRV_USART_BufferCompletedBytesGet
16435  (
16436  DRV_USART_BUFFER_HANDLE bufferHandle
16437  );
16438  Summary:
16439  Returns the number of bytes that have been processed for the
16440  specified buffer.
16441  <p><b>Implementation:</b> Static/Dynamic</p>
16442  Description:
16443  This function returns number of bytes that have been processed for the
16444  specified buffer. The client can use this function, in a case where the
16445  buffer has terminated due to an error, to obtain the number of bytes that
16446  have been processed. Or in any other use case.
16447  This function can be used for non-DMA buffer transfers only. It cannot be
16448  used when the USART driver is configured to use DMA.
16449  Precondition:
16450  The DRV_USART_Initialize routine must have been called for the specified
16451  USART driver instance.
16452  DRV_USART_Open must have been called to obtain a valid opened device handle.
16453  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16454  must have been called and a valid buffer handle returned.
16455  Parameters:
16456  bufferhandle - Handle for the buffer of which the processed number of bytes
16457  to be obtained.
16458  Returns:
16459  Returns the number of bytes that have been processed for this buffer.
16460  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16461  buffer handle.
16462  Example:
16463  <code>
16464  // myAppObj is an application specific object.
16465  MY_APP_OBJ myAppObj;
16466  uint8_t mybuffer[MY_BUFFER_SIZE];
16467  DRV_USART_BUFFER_HANDLE bufferHandle;
16468  // myUSARTHandle is the handle returned
16469  // by the DRV_USART_Open function.
16470  // Client registers an event handler with driver. This is done once
16471  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16472  (uintptr_t)&myAppObj );
16473  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16474  myBuffer, MY_BUFFER_SIZE );
16475  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16476  {
16477  // Error handling here
16478  }
16479  // Event Processing Technique. Event is received when
16480  // the buffer is processed.
16481  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16482  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16483  {
16484  // The context handle was set to an application specific
16485  // object. It is now retrievable easily in the event handler.
16486  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16487  size_t processedBytes;
16488  switch(event)
16489  {
16490  case DRV_USART_BUFFER_EVENT_COMPLETE:
16491  // This means the data was transferred.
16492  break;
16493  case DRV_USART_BUFFER_EVENT_ERROR:
16494  // Error handling here.
16495  // We can find out how many bytes were processed in this
16496  // buffer before the error occurred.
16497  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16498  break;
16499  default:
16500  break;
16501  }
16502  }
16503  </code>
16504  Remarks:
16505  This function is thread safe when used in a RTOS application.
16506 */
16507 
16508 size_t
16510  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16511 // *****************************************************************************
16512 /* Function:
16513  size_t DRV_USART_BufferProcessedSizeGet
16514  (
16515  DRV_USART_BUFFER_HANDLE bufferHandle
16516  );
16517  Summary:
16518  This API will be deprecated and not recommended to use.
16519  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16520  processed for the specified buffer.
16521  Description:
16522  None.
16523  Precondition:
16524  None.
16525  Parameters:
16526  None.
16527  Returns:
16528  None.
16529  Example:
16530  None.
16531  Remarks:
16532  None.
16533 */
16534 
16535 size_t
16537  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16538 // *****************************************************************************
16539 // *****************************************************************************
16540 // Section: USART Driver File System Model Routines
16541 // *****************************************************************************
16542 // *****************************************************************************
16543 // *****************************************************************************
16544 /* Function:
16545  size_t DRV_USART_Read
16546  (
16547  const DRV_HANDLE handle,
16548  void * buffer,
16549  const size_t numbytes
16550  )
16551  Summary:
16552  Reads data from the USART.
16553  <p><b>Implementation:</b> Static/Dynamic</p>
16554  Description:
16555  This routine reads data from the USART. This function is blocking if the
16556  driver was opened by the client for blocking operation. This function will
16557  not block if the driver was opened by the client for non blocking operation.
16558  If the ioIntent parameter at the time of opening the driver was
16559  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16560  until) numbytes of bytes have been received or if an error occurred. If there
16561  are buffers queued for receiving data, these buffers will be serviced first. The
16562  function will not return until the requested number of bytes have been read.
16563  If the ioIntent parameter at the time of opening the driver was
16564  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16565  bytes that were actually read. The function will not wait until numBytes of
16566  bytes have been read. If there are buffer queued for reading data, then the
16567  function will not block and will return immediately with 0 bytes read.
16568  Precondition:
16569  The DRV_USART_Initialize routine must have been called for the specified
16570  USART driver instance.
16571  DRV_USART_Open must have been called to obtain a valid opened device handle.
16572  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16573  the DRV_USART_Open call.
16574  Parameters:
16575  handle - A valid open-instance handle, returned from the driver's
16576  open routine
16577  buffer - Buffer into which the data read from the USART instance
16578  will be placed.
16579  numbytes - Total number of bytes that need to be read from the module
16580  instance (must be equal to or less than the size of the
16581  buffer)
16582  Returns:
16583  Number of bytes actually copied into the caller's buffer. Returns
16584  DRV_USART_READ_ERROR in case of an error.
16585  Example:
16586  <code>
16587  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16588  char myBuffer[MY_BUFFER_SIZE];
16589  unsigned int count;
16590  unsigned int total;
16591  total = 0;
16592  do
16593  {
16594  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
16595  if(count == DRV_USART_READ_ERROR)
16596  {
16597  // There was an error. The DRV_USART_ErrorGet() function
16598  // can be called to find the exact error.
16599  }
16600  total += count;
16601  // Do something else...
16602  } while( total < MY_BUFFER_SIZE );
16603  </code>
16604  Remarks:
16605  This function is thread safe in a RTOS application. If the driver is
16606  configured for polled operation, this it will not support blocking operation
16607  in a bare metal (non-RTOS) application.
16608 */
16609 
16610 size_t
16611  DRV_USART_Read (
16612  const DRV_HANDLE handle ,
16613  void * buffer ,
16614  const size_t numbytes ) ;
16615 // *****************************************************************************
16616 /* Function:
16617  size_t DRV_USART_Write
16618  (
16619  const DRV_HANDLE handle,
16620  void * buffer,
16621  const size_t numbytes
16622  )
16623  Summary:
16624  Writes data to the USART.
16625  <p><b>Implementation:</b> Static/Dynamic</p>
16626  Description:
16627  This routine writes data to the USART. This function is blocking if the
16628  driver was opened by the client for blocking operation. This function will
16629  not block if the driver was opened by the client for non blocking operation.
16630  If the ioIntent parameter at the time of opening the driver was
16631  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16632  until) numbytes of bytes have been transmitted or if an error occurred. If
16633  there are buffers queued for writing, the function will wait until all the
16634  preceding buffers are completed. Ongoing buffer transmit operations will not
16635  be affected.
16636  If the ioIntent parameter at the time of opening the driver was
16637  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16638  bytes that were actually accepted for transmission. The function will not
16639  wait until numBytes of bytes have been transmitted. If there a buffers queued
16640  for transmit, the function will not wait and will return immediately with 0
16641  bytes.
16642  Precondition:
16643  The DRV_USART_Initialize routine must have been called for the specified
16644  USART driver instance.
16645  DRV_USART_Open must have been called to obtain a valid opened device handle.
16646  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16647  the DRV_USART_Open call.
16648  Parameters:
16649  handle - A valid open-instance handle, returned from the driver's
16650  open routine
16651  buffer - Buffer containing the data to written.
16652  numbytes - size of the buffer
16653  Returns:
16654  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
16655  in case of an error.
16656  Example:
16657  <code>
16658  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16659  char myBuffer[MY_BUFFER_SIZE];
16660  int count;
16661  unsigned int total;
16662  total = 0;
16663  do
16664  {
16665  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
16666  MY_BUFFER_SIZE - total);
16667  total += count;
16668  // Do something else...
16669  } while( total < MY_BUFFER_SIZE );
16670  </code>
16671  Remarks:
16672  This function is thread safe in a RTOS application. This function is thread
16673  safe in a RTOS application. If the driver is configured for polled
16674  operation, this it will not support blocking operation in a bare metal (non-RTOS)
16675  application.
16676 */
16677 
16678 size_t
16679  DRV_USART_Write (
16680  const DRV_HANDLE handle ,
16681  void * buffer ,
16682  const size_t numbytes ) ;
16683 // *****************************************************************************
16684 /* Function:
16685  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
16686  Summary:
16687  Returns the transmitter and receiver transfer status.
16688  <p><b>Implementation:</b> Static/Dynamic</p>
16689  Description:
16690  This returns the transmitter and receiver transfer status.
16691  Precondition:
16692  The DRV_USART_Initialize routine must have been called for the specified
16693  USART driver instance.
16694  DRV_USART_Open must have been called to obtain a valid opened device handle.
16695  Parameters:
16696  handle - A valid open-instance handle, returned from the driver's
16697  open routine
16698  Returns:
16699  A DRV_USART_TRANSFER_STATUS value describing the current status
16700  of the transfer.
16701  Example:
16702  <code>
16703  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16704  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
16705  {
16706  // Data has been received that can be read
16707  }
16708  </code>
16709  Remarks:
16710  The returned status may contain a value with more than one of the bits
16711  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
16712  should perform an "AND" with the bit of interest and verify if the result is
16713  non-zero (as shown in the example) to verify the desired status bit. This
16714  function is thread safe when called in a RTOS application.
16715 */
16716 
16719  const DRV_HANDLE handle ) ;
16720 // *****************************************************************************
16721 // *****************************************************************************
16722 // Section: USART Driver Byte Model Routines
16723 // *****************************************************************************
16724 // *****************************************************************************
16725 // *****************************************************************************
16726 /* Function:
16727  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
16728  Summary:
16729  Reads a byte of data from the USART.
16730  <p><b>Implementation:</b> Static/Dynamic</p>
16731  Description:
16732  This routine reads a byte of data from the USART.
16733  Precondition:
16734  The DRV_USART_Initialize routine must have been called for the specified
16735  USART driver instance.
16736  DRV_USART_Open must have been called to obtain a valid opened device handle.
16737  The transfer status should be checked to see if the receiver is not empty
16738  before calling this function.
16739  Parameters:
16740  handle - A valid open-instance handle, returned from the driver's
16741  open routine
16742  Returns:
16743  A data byte received by the driver.
16744  Example:
16745  <code>
16746  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16747  char myBuffer[MY_BUFFER_SIZE];
16748  unsigned int numBytes;
16749  numBytes = 0;
16750  do
16751  {
16752  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
16753  {
16754  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
16755  }
16756  // Do something else...
16757  } while( numBytes < MY_BUFFER_SIZE);
16758  </code>
16759  Remarks:
16760  This function is thread safe when called in a RTOS application. Note that
16761  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16762  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16763  DRV_USART_Write functions in a application. Calling the
16764  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
16765  processing of any queued buffers.
16766 */
16767 
16768 uint8_t
16770  const DRV_HANDLE handle ) ;
16771 // *****************************************************************************
16772 /* Function:
16773  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
16774  Summary:
16775  Writes a byte of data to the USART.
16776  <p><b>Implementation:</b> Static/Dynamic</p>
16777  Description:
16778  This routine writes a byte of data to the USART.
16779  Precondition:
16780  The DRV_USART_Initialize routine must have been called for the specified
16781  USART driver instance.
16782  DRV_USART_Open must have been called to obtain a valid opened device handle.
16783  The transfer status should be checked to see if transmitter is not full
16784  before calling this function.
16785  Parameters:
16786  handle - A valid open-instance handle, returned from the driver's
16787  open routine
16788  byte - Data byte to write to the USART
16789  Returns:
16790  None.
16791  Example:
16792  <code>
16793  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16794  char myBuffer[MY_BUFFER_SIZE];
16795  unsigned int numBytes;
16796  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
16797  numBytes = 0;
16798  while( numBytes < MY_BUFFER_SIZE );
16799  {
16800  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
16801  {
16802  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
16803  }
16804  // Do something else...
16805  }
16806  </code>
16807  Remarks:
16808  This function is thread safe when called in a RTOS application. Note that
16809  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16810  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16811  DRV_USART_Write functions in a application. Calling the
16812  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
16813  processing of any queued buffers.
16814 */
16815 
16816 void
16818  const DRV_HANDLE handle ,
16819  const uint8_t byte ) ;
16820 // *****************************************************************************
16821 /* Function:
16822  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
16823  Summary:
16824  Returns the size of the receive buffer.
16825  <p><b>Implementation:</b> Static/Dynamic</p>
16826  Description:
16827  This routine returns the size of the receive buffer.
16828  Precondition:
16829  The DRV_USART_Initialize routine must have been called for the specified
16830  USART driver instance.
16831  DRV_USART_Open must have been called to obtain a valid opened device handle.
16832  Parameters:
16833  handle - A valid open-instance handle, returned from the driver's
16834  open routine
16835  Returns:
16836  Size of the driver's receive buffer, in bytes.
16837  Example:
16838  <code>
16839  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16840  const uint8_t readBuffer[5];
16841  unsigned int size, numBytes = 0;
16842  unsigned int readbufferLen = sizeof(readBuffer);
16843  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
16844  // Do something based on the receiver buffer size
16845  </code>
16846  Remarks:
16847  Does not account for client queued buffers. This function is thread safe
16848  when called in a RTOS application.
16849 */
16850 
16851 unsigned int
16853  const DRV_HANDLE handle ) ;
16854 // *****************************************************************************
16855 /* Function:
16856  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
16857  Summary:
16858  Returns the size of the transmit buffer.
16859  <p><b>Implementation:</b> Static/Dynamic</p>
16860  Description:
16861  This routine returns the size of the transmit buffer and can be used by the
16862  application to determine the number of bytes to write with the
16863  DRV_USART_WriteByte function.
16864  Precondition:
16865  The DRV_USART_Initialize routine must have been called for the specified
16866  USART driver instance.
16867  DRV_USART_Open must have been called to obtain a valid opened device handle.
16868  Parameters:
16869  handle - A valid open-instance handle, returned from the driver's
16870  open routine
16871  Returns:
16872  Size of the driver's transmit buffer, in bytes.
16873  Examples:
16874  <code>
16875  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16876  const uint8_t writeBuffer[5];
16877  unsigned int size, numBytes = 0;
16878  unsigned int writeBufferLen = sizeof(writeBuffer);
16879  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
16880  // Do something based on the transmitter buffer size
16881  </code>
16882  Remarks:
16883  Does not account for client queued buffers. This function is thread safe
16884  when used in a RTOS application.
16885 */
16886 
16887 unsigned int
16889  const DRV_HANDLE handle ) ;
16890 // *****************************************************************************
16891 /* Function:
16892  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
16893  Summary:
16894  Provides the status of the driver's receive buffer.
16895  <p><b>Implementation:</b> Static/Dynamic</p>
16896  Description:
16897  This routine indicates if the driver's receiver buffer is empty. This
16898  function can be used in conjunction with the DRV_USART_Read and
16899  DRV_USART_ReadByte functions.
16900  Precondition:
16901  The DRV_USART_Initialize routine must have been called for the specified
16902  USART driver instance.
16903  DRV_USART_Open must have been called to obtain a valid opened device handle.
16904  Parameters:
16905  handle - A valid open-instance handle, returned from the driver's
16906  open routine
16907  Returns:
16908  true - if the driver's receive buffer is empty
16909  false - if the driver's receive buffer is not empty
16910  Example:
16911  <code>
16912  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16913  char myBuffer[MY_BUFFER_SIZE];
16914  unsigned int numBytes;
16915  numBytes = 0;
16916  while( numBytes < MY_BUFFER_SIZE );
16917  {
16918  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
16919  {
16920  if( numBytes < MY_BUFFER_SIZE )
16921  {
16922  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
16923  }
16924  else
16925  {
16926  break;
16927  }
16928  }
16929  // Do something else while more data is received.
16930  }
16931  </code>
16932  Remarks:
16933  Does not account for client queued buffers. This function is safe thread
16934  safe when used in a RTOS application.
16935 */
16936 
16937 bool
16939  const DRV_HANDLE handle ) ;
16940 // *****************************************************************************
16941 /* Function:
16942  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
16943  Summary:
16944  Provides the status of the driver's transmit buffer.
16945  <p><b>Implementation:</b> Static/Dynamic</p>
16946  Description:
16947  This routine identifies if the driver's transmit buffer is full or not. This
16948  function can be used in conjunction with the DRV_USART_Write and
16949  DRV_USART_WriteByte functions.
16950  Precondition:
16951  The DRV_USART_Initialize routine must have been called for the specified
16952  USART driver instance.
16953  DRV_USART_Open must have been called to obtain a valid opened device handle.
16954  Parameters:
16955  handle - A valid open-instance handle, returned from the driver's
16956  open routine
16957  Returns:
16958  true - if the transmit buffer is full
16959  false - if the transmit buffer is not full
16960  Example:
16961  <code>
16962  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16963  unsigned int numBytes;
16964  int bytesToWrite;
16965  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
16966  int writebufferLen = strlen((char *)writeBuffer);
16967  numBytes = 0;
16968  while( numBytes < writebufferLen )
16969  {
16970  if (DRV_USART_TransmitBufferisFull())
16971  {
16972  // Do something else until there is some room in the driver's Transmit buffer.
16973  }
16974  else
16975  {
16976  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
16977  }
16978  }
16979  </code>
16980  Remarks:
16981  Does not account for client queued buffers. This function is thread safe
16982  when called in a RTOS application.
16983 */
16984 
16985 bool
16987  const DRV_HANDLE handle ) ;
16988 // *****************************************************************************
16989 /* Function:
16990  void DRV_USART_ByteTransmitCallbackSet
16991  (
16992  const SYS_MODULE_INDEX index,
16993  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
16994  )
16995  Summary:
16996  Registers a callback function for byte transmit event.
16997  Description:
16998  This function allows a transmit callback function to be registered with the
16999  driver. The callback function is invoked when a byte has been transmitted
17000  using DRV_USART_WriteByte () function.
17001  The callback function should be registered with the driver prior to any
17002  writes to the driver. The callback functionality is available only in the
17003  interrupt mode of operation. The driver clears the interrupt after invoking
17004  the callback function.
17005  Precondition:
17006  The DRV_USART_Initialize routine must have been called for the specified
17007  USART driver instance.
17008  Parameters:
17009  index - Identifier for the object instance to be opened
17010  eventHandler - Pointer to the event handler function.
17011  Returns:
17012  None.
17013  Example:
17014  <code>
17015  // myAppObj is an application specific state data object.
17016  MY_APP_OBJ myAppObj;
17017  uint8_t mybuffer[MY_BUFFER_SIZE];
17018  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17019  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17020  (uintptr_t)&myAppObj );
17021  // Register an event handler with driver. This is done once
17022  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17023  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17024  // Event Processing Technique. Event is received when
17025  // the byte is transmitted.
17026  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17027  {
17028  // Byte has been transmitted. Handle the event.
17029  }
17030  </code>
17031  Remarks:
17032  None
17033 */
17034 
17035 void
17037  const SYS_MODULE_INDEX index ,
17038  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17039 // *****************************************************************************
17040 /* Function:
17041  void DRV_USART_ByteReceiveCallbackSet
17042  (
17043  const SYS_MODULE_INDEX index,
17044  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17045  )
17046  Summary:
17047  Registers receive callback function for byte receive event.
17048  Description:
17049  This function allows a receive callback function to be registered with the
17050  driver. The callback function is invoked when a byte has been received. The
17051  received byte can then be read using DRV_USART_ReadByte() function.
17052  The callback function should be registered with the driver as part of the
17053  initialization. The callback functionality is available only in the
17054  interrupt mode of operation. The driver clears the interrupt after invoking
17055  the callback function.
17056  Precondition:
17057  The DRV_USART_Initialize routine must have been called for the specified
17058  USART driver instance.
17059  Parameters:
17060  index - Identifier for the object instance to be opened
17061  eventHandler - Pointer to the event handler function.
17062  Returns:
17063  None.
17064  Example:
17065  <code>
17066  // myAppObj is an application specific state data object.
17067  MY_APP_OBJ myAppObj;
17068  uint8_t mybuffer[MY_BUFFER_SIZE];
17069  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17070  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17071  (uintptr_t)&myAppObj );
17072  // Register an event handler with driver. This is done once
17073  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17074  // Event Processing Technique. Event is received when
17075  // a byte is received.
17076  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17077  {
17078  // Byte has been Received. Handle the event.
17079  // Read byte using DRV_USART_ReadByte ()
17080  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17081  // check if the receiver buffer is empty.
17082  }
17083  </code>
17084  Remarks:
17085  None
17086 */
17087 
17088 void
17090  const SYS_MODULE_INDEX index ,
17091  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17092 // *****************************************************************************
17093 /* Function:
17094  void DRV_USART_ByteErrorCallbackSet
17095  (
17096  const SYS_MODULE_INDEX index,
17097  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17098  )
17099  Summary:
17100  Registers callback to handle for byte error events.
17101  Description:
17102  This function allows a callback function to be registered with the driver
17103  to handle the error events occurring in the transmit/receive path during
17104  byte transfers.
17105  The callback function should be registered as part of the initialization.
17106  The callback functionality is available only in the interrupt mode of
17107  operation. The driver clears the interrupt after invoking the callback
17108  function.
17109  Precondition:
17110  The DRV_USART_Initialize routine must have been called for the specified
17111  USART driver instance.
17112  Parameters:
17113  index - Identifier for the object instance to be opened
17114  eventHandler - Pointer to the event handler function.
17115  Returns:
17116  None.
17117  Example:
17118  <code>
17119  // myAppObj is an application specific state data object.
17120  MY_APP_OBJ myAppObj;
17121  uint8_t mybuffer[MY_BUFFER_SIZE];
17122  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17123  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17124  (uintptr_t)&myAppObj );
17125  // Register an event handler with driver. This is done once
17126  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17127  // Event Processing Technique.
17128  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17129  {
17130  // Error has occurred. Handle the event.
17131  }
17132  </code>
17133  Remarks:
17134  None
17135 */
17136 
17137 void
17139  const SYS_MODULE_INDEX index ,
17140  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17141 // *****************************************************************************
17142 // *****************************************************************************
17143 // Section: USART Driver Setup and Status Routines
17144 // *****************************************************************************
17145 // *****************************************************************************
17146 // *****************************************************************************
17147 /* Function:
17148  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17149  Summary:
17150  This function returns the error(if any) associated with the last client
17151  request.
17152  <p><b>Implementation:</b> Static/Dynamic</p>
17153  Description:
17154  This function returns the error(if any) associated with the last client
17155  request. DRV_USART_Read and DRV_USART_Write will update the client
17156  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17157  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17158  call this function to know the error cause. The error status will be updated
17159  on every operation and should be read frequently (ideally immediately after
17160  the driver operation has completed) to know the relevant error status.
17161  Precondition:
17162  The DRV_USART_Initialize routine must have been called for the specified
17163  USART driver instance.
17164  DRV_USART_Open must have been called to obtain a valid opened device handle.
17165  Parameters:
17166  bufferhandle - Handle of the buffer of which the processed number of bytes
17167  to be obtained.
17168  Returns:
17169  A DRV_USART_ERROR type indicating last known error status.
17170  Example:
17171  <code>
17172  // myAppObj is an application specific object.
17173  MY_APP_OBJ myAppObj;
17174  uint8_t mybuffer[MY_BUFFER_SIZE];
17175  DRV_USART_BUFFER_HANDLE bufferHandle;
17176  // myUSARTHandle is the handle returned
17177  // by the DRV_USART_Open function.
17178  // Client registers an event handler with driver. This is done once.
17179  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17180  (uintptr_t)&myAppObj );
17181  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17182  myBuffer, MY_BUFFER_SIZE );
17183  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17184  {
17185  // Error handling here
17186  }
17187  // Event Processing Technique. Event is received when
17188  // the buffer is processed.
17189  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17190  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17191  {
17192  // The context handle was set to an application specific
17193  // object. It is now retrievable easily in the event handler.
17194  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17195  size_t processedBytes;
17196  switch(event)
17197  {
17198  case DRV_USART_BUFFER_EVENT_COMPLETE:
17199  // This means the data was transferred.
17200  break;
17201  case DRV_USART_BUFFER_EVENT_ERROR:
17202  // Error handling here.
17203  // We can find out how many bytes were processed in this
17204  // buffer before the error occurred. We can also find
17205  // the error cause.
17206  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17207  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17208  {
17209  // There was an receive over flow error.
17210  // Do error handling here.
17211  }
17212  break;
17213  default:
17214  break;
17215  }
17216  }
17217  </code>
17218  Remarks:
17219  It is the client's responsibility to make sure that the error status is
17220  obtained frequently. The driver will update the client error status
17221  regardless of whether this has been examined by the client. This function
17222  is thread safe when used in a RTOS application.
17223 */
17224 
17227  const DRV_HANDLE client ) ;
17228 // *****************************************************************************
17229 /* Function:
17230  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17231  Summary:
17232  This function changes the USART module baud to the specified value.
17233  <p><b>Implementation:</b> Static/Dynamic</p>
17234  Description:
17235  This function changes the USART module baud to the specified value. Any
17236  queued buffer requests will be processed at the updated baud. The USART
17237  driver operates at the baud specified in DRV_USART_Initialize function
17238  unless the DRV_USART_BaudSet function is called to change the baud.
17239  Precondition:
17240  The DRV_USART_Initialize routine must have been called for the specified
17241  USART driver instance.
17242  DRV_USART_Open must have been called to obtain a valid opened device handle.
17243  Parameters:
17244  handle - client handle returned by DRV_USART_Open function.
17245  baud - desired baud.
17246  Returns:
17247  None.
17248  Example:
17249  <code>
17250  // myUSARTHandle is the handle returned
17251  // by the DRV_USART_Open function.
17252  DRV_USART_BaudSet(myUSARTHandle, 9600);
17253  </code>
17254  Remarks:
17255  The implementation of this function, in this release of the driver, changes
17256  the baud immediately. This may interrupt on-going data transfer. It is
17257  recommended that the driver be opened exclusively if this function is to be
17258  called. This function is thread safe when used in a RTOS application.
17259 */
17260 
17263  const DRV_HANDLE client ,
17264  uint32_t baud ) ;
17265 // *****************************************************************************
17266 /* Function:
17267  void DRV_USART_LineControlSet
17268  (
17269  DRV_HANDLE client,
17270  DRV_USART_LINE_CONTROL lineControl
17271  );
17272  Summary:
17273  This function changes the USART module line control to the specified value.
17274  <p><b>Implementation:</b> Static/Dynamic</p>
17275  Description:
17276  This function changes the USART module line control parameters to the
17277  specified value. Any queued buffer requests will be processed at the
17278  updated line control parameters. The USART driver operates at the line
17279  control parameters specified in DRV_USART_Initialize function unless the
17280  DRV_USART_LineControlSet function is called to change the line control
17281  parameters.
17282  Precondition:
17283  The DRV_USART_Initialize routine must have been called for the specified
17284  USART driver instance.
17285  DRV_USART_Open must have been called to obtain a valid opened device handle.
17286  Parameters:
17287  handle - client handle returned by DRV_USART_Open function.
17288  lineControl - line control parameters.
17289  Returns:
17290  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17291  DRV_HANDLE_INVALID if the client handle is not valid.
17292  Example:
17293  <code>
17294  // myUSARTHandle is the handle returned
17295  // by the DRV_USART_Open function.
17296  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17297  </code>
17298  Remarks:
17299  The implementation of this function, in this release of the driver, changes
17300  the line control immediately. This may interrupt on-going data transfer. It
17301  is recommended that the driver be opened exclusively if this function is to
17302  be called. This function is thread safe when called in a RTOS application.
17303 */
17304 
17307  const DRV_HANDLE client ,
17308  const DRV_USART_LINE_CONTROL lineControl ) ;
17309 //DOM-IGNORE-BEGIN
17310 //DOM-IGNORE-END
17311  // #ifndef _DRV_USART_H
17312 /*******************************************************************************
17313  End of File
17314 */
17315 
17316 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17317 /* CLOSE_FILE Include File */
17318 
17319 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17320 /*******************************************************************************
17321  USART Driver Variant Mapping
17322  Company:
17323  Microchip Technology Inc.
17324  File Name:
17325  drv_usart_variant_mapping.h
17326  Summary:
17327  USART Driver Variant Mapping
17328  Description:
17329  This file provides feature and build variant mapping macros allowing the
17330  driver to easily be built with different implementation variations based
17331  on static build-time configuration selections.
17332 *******************************************************************************/
17333 //DOM-IGNORE-BEGIN
17334 /*******************************************************************************
17335 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17336 Microchip licenses to you the right to use, modify, copy and distribute
17337 Software only when embedded on a Microchip microcontroller or digital signal
17338 controller that is integrated into your product or third party product
17339 (pursuant to the sublicense terms in the accompanying license agreement).
17340 You should refer to the license agreement accompanying this Software for
17341 additional information regarding your rights and obligations.
17342 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17343 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17344 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17345 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17346 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17347 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17348 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17349 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17350 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17351 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17352 *******************************************************************************/
17353 //DOM-IGNORE-END
17354 #ifndef _DRV_USART_FEATURE_MAPPING_H
17355 #define _DRV_USART_FEATURE_MAPPING_H
17356 // *****************************************************************************
17357 // *****************************************************************************
17358 // Section: Interrrupt Variations
17359 // *****************************************************************************
17360 // *****************************************************************************
17361 /* Mapping of the interrupt mode variations
17362 */
17363  /* Driver is configured for polled mode */
17364 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17365 #define _DRV_USART_InterruptSourceEnable( source )
17366 #define _DRV_USART_InterruptSourceDisable( source ) false
17367 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17368 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17369 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17370 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17371 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17372  /* This means the driver is being built in a baremetal application.
17373  We cannot let a client open the driver in blocking mode */
17374 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17375 // *****************************************************************************
17376 // *****************************************************************************
17377 // Section: Buffer Queue support
17378 // *****************************************************************************
17379 // *****************************************************************************
17380 /* Mapping of macros for buffer queue support
17381 */
17382  /* We dont need buffer queues or byte model support */
17383 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17384 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17385 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17386 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17387 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17388 // *****************************************************************************
17389 // *****************************************************************************
17390 // Initializtion Parameter Static Overrides
17391 // *****************************************************************************
17392 // *****************************************************************************
17393  //_DRV_USART_FEATURE_MAPPING_H
17394 /*******************************************************************************
17395  End of File
17396 */
17397 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17398 /* CLOSE_FILE Include File */
17399 
17400 #include "system/clk/sys_clk.h"
17401 #include "system/int/sys_int.h"
17402 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17403 /*******************************************************************************
17404  Debug System Services Library Header
17405  Company:
17406  Microchip Technology Inc.
17407 
17408  File Name:
17409  sys_debug.h
17410  Summary:
17411  Defines the common debug definitions and interfaces used by MPLAB Harmony
17412  libraries to report errors and debug information to the user.
17413  Description:
17414  This header file defines the common debug definitions and interface macros
17415  (summary below) and prototypes used by MPLAB Harmony libraries to report
17416  errors and debug information to the user.
17417  *******************************************************************************/
17418 //DOM-IGNORE-BEGIN
17419 /*******************************************************************************
17420 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17421 Microchip licenses to you the right to use, modify, copy and distribute
17422 Software only when embedded on a Microchip microcontroller or digital signal
17423 controller that is integrated into your product or third party product
17424 (pursuant to the sublicense terms in the accompanying license agreement).
17425 You should refer to the license agreement accompanying this Software for
17426 additional information regarding your rights and obligations.
17427 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17428 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17429 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17430 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17431 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17432 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17433 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17434 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17435 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17436 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17437  *******************************************************************************/
17438 //DOM-IGNORE-END
17439 #ifndef _SYS_DEBUG_H
17440 #define _SYS_DEBUG_H
17441 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17442  /* LDRA full path */
17443 // This should be defined in system_config.h. It is added here as a build safe-guard.
17444 #define SYS_DEBUG_BUFFER_DMA_READY
17445 // *****************************************************************************
17446 // *****************************************************************************
17447 // Section: SYS DEBUG Data Types
17448 // *****************************************************************************
17449 // *****************************************************************************
17450 // *****************************************************************************
17451 /* SYS_ERROR_LEVEL enumeration
17452  Summary:
17453  System error message priority levels.
17454  Description:
17455  This enumeration defines the supported system error message priority values.
17456  Remarks:
17457  Used by debug message macros to compare individual message priority against
17458  a global system-wide error message priority level to determine if an
17459  individual message should be displayed.
17460 */
17461 
17462 typedef
17463  enum
17464  {
17465  /* Errors that have the potential to cause a system crash. */
17467  /* Errors that have the potential to cause incorrect behavior. */
17469  /* Warnings about potentially unexpected behavior or side effects. */
17471  /* Information helpful to understanding potential errors and warnings. */
17473  /* Verbose information helpful during debugging and testing. */
17475  } SYS_ERROR_LEVEL ;
17476 // DOM-IGNORE-BEGIN
17477 // *****************************************************************************
17478 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17479  SYS_DEBUG_ErrorLevelSet functions to access this value.
17480 */
17481 
17482 extern SYS_ERROR_LEVEL
17483  gblErrLvl ;
17484 // DOM-IGNORE-END
17485 // *****************************************************************************
17486 /* SYS Debug Module Index Number
17487  Summary:
17488  Debug System Service index.
17489  Description:
17490  This constant defines a symbolic name for the debug system service index.
17491  Remarks:
17492  There can only be a single debug system service instance in the system.
17493 */
17494 #define SYS_DEBUG_INDEX_0 0
17495 // *****************************************************************************
17496 /* SYS Debug Initialize structure
17497  Summary:
17498  Defines the data required to initialize the debug system service.
17499  Description:
17500  This structure defines the data required to initialize the debug system
17501  service.
17502  Remarks:
17503  None.
17504 */
17505 
17506 typedef
17507  struct
17508  {
17509  /* System module initialization */
17510  SYS_MODULE_INIT moduleInit ;
17511  /* Initial system error level setting. */
17512  SYS_ERROR_LEVEL errorLevel ;
17513  /* Console index to receive debug messages */
17514  SYS_MODULE_INDEX consoleIndex ;
17515  } SYS_DEBUG_INIT ;
17516 // *****************************************************************************
17517 // *****************************************************************************
17518 // Section: SYS DEBUG Functions
17519 // *****************************************************************************
17520 // *****************************************************************************
17521 // *****************************************************************************
17522 /* Function:
17523  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17524  const SYS_MODULE_INIT * const init )
17525  Summary:
17526  Initializes the global error level and specific module instance.
17527  Description:
17528  This function initializes the global error level. It also initializes any
17529  internal system debug module data structures.
17530  Precondition:
17531  None.
17532  Parameters:
17533  index - Index for the instance to be initialized
17534  init - Pointer to a data structure containing any data necessary
17535  to initialize the debug service. This pointer may be null
17536  if no data is required because static overrides have
17537  been provided.
17538  Returns:
17539  If successful, returns a valid handle to an object. Otherwise, it
17540  returns SYS_MODULE_OBJ_INVALID.
17541  Example:
17542  <code>
17543  SYS_MODULE_OBJ objectHandle;
17544  SYS_DEBUG_INIT debugInit =
17545  {
17546  .moduleInit = {0},
17547  .errorLevel = SYS_ERROR_DEBUG,
17548  };
17549  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
17550  if (SYS_MODULE_OBJ_INVALID == objectHandle)
17551  {
17552  // Handle error
17553  }
17554  </code>
17555  Remarks:
17556  This routine should only be called once during system initialization. If the
17557  system was already initialized it safely returns without causing any disturbance.
17558 */
17559 
17560 SYS_MODULE_OBJ
17562  const SYS_MODULE_INDEX index ,
17563  const SYS_MODULE_INIT * const init ) ;
17564 // *****************************************************************************
17565 /* Function:
17566  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
17567  const SYS_MODULE_INIT * const init )
17568  Summary:
17569  Reinitializes and refreshes the data structure for the instance of the
17570  Debug module.
17571  Description:
17572  This function reinitializes and refreshes the data structure for the instance
17573  of the Debug module using the supplied data.
17574  Precondition:
17575  The SYS_DEBUG_Initialize function should have been called before calling
17576  this function.
17577  Parameters:
17578  object - Identifies the SYS DEBUG Object returned by the Initialize
17579  interface
17580  init - Pointer to the data structure containing any data
17581  necessary to initialize the hardware
17582  Returns:
17583  None
17584  Example:
17585  <code>
17586  SYS_MODULE_OBJ objectHandle;
17587  // Populate the console initialization structure
17588  SYS_DEBUG_INIT dbgInit =
17589  {
17590  .moduleInit = {0},
17591  .errorLevel = SYS_ERROR_DEBUG,
17592  };
17593  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
17594  </code>
17595  Remarks:
17596  This operation uses the same initialization data structure as the
17597  SYS_DEBUG_Initialize operation. This function can be called multiple times
17598  to reinitialize the module.
17599 */
17600 
17601 void
17603  SYS_MODULE_OBJ object ,
17604  const SYS_MODULE_INIT * const init ) ;
17605 // *****************************************************************************
17606 /* Function:
17607  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
17608  Summary:
17609  Deinitializes the specific module instance of the Debug module.
17610  Description:
17611  This function deinitializes the specific module instance disabling its
17612  operation (and any hardware for driver modules). Resets all of the internal
17613  data structures and fields for the specified instance to the default settings.
17614  Precondition:
17615  The SYS_DEBUG_Initialize function should have been called before calling
17616  this function.
17617  Parameters:
17618  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17619  Returns:
17620  None.
17621  Example:
17622  <code>
17623  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17624  SYS_DEBUG_Deinitialize (object);
17625  </code>
17626  Remarks:
17627  Once the Initialize operation has been called, the Deinitialize
17628  operation must be called before the Initialize operation can be called
17629  again.
17630 */
17631 
17632 void
17634  SYS_MODULE_OBJ object ) ;
17635 // *****************************************************************************
17636 /* Function:
17637  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
17638  Summary:
17639  Maintains the debug module's state machine.
17640  Description:
17641  This function is used to maintain the debug module's internal state
17642  machine and implement its ISR for interrupt-driven implementations.
17643  Precondition:
17644  The SYS_DEBUG_Initialize function must have been called for the specified
17645  CONSOLE driver instance.
17646  Parameters:
17647  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17648  Returns:
17649  None.
17650  Example:
17651  <code>
17652  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17653  while (true)
17654  {
17655  SYS_DEBUG_Tasks (object);
17656  // Do other tasks
17657  }
17658  </code>
17659  Remarks:
17660  This function is normally not called directly by an application. It is
17661  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
17662  ISR.
17663 */
17664 
17665 void
17666  SYS_DEBUG_Tasks (
17667  SYS_MODULE_OBJ object ) ;
17668 // *****************************************************************************
17669 /* Function:
17670  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
17671  Summary:
17672  Returns status of the specific instance of the debug service module.
17673  Description:
17674  This function returns the status of the specific debug service module
17675  instance.
17676  Precondition:
17677  The SYS_CONSOLE_Initialize function should have been called before calling
17678  this function.
17679  Parameters:
17680  object - Debug module object handle, returned from SYS_DEBUG_Initialize
17681  Returns:
17682  * SYS_STATUS_READY - Indicates that the module is running and
17683  ready to service requests. Any value greater
17684  than SYS_STATUS_READY is also a normal
17685  running state in which the module is ready
17686  to accept new operations.
17687  * SYS_STATUS_BUSY - Indicates that the module is busy with a
17688  previous system level operation and cannot
17689  start another.
17690  * SYS_STATUS_ERROR - Indicates that the module is in an error
17691  state. Any value less than SYS_STATUS_ERROR
17692  is also an error state.
17693  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
17694  initialized or has been deinitialized.
17695  Example:
17696  <code>
17697  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
17698  SYS_STATUS debugStatus;
17699  debugStatus = SYS_DEBUG_Status (object);
17700  if (SYS_STATUS_ERROR >= debugStatus)
17701  {
17702  // Handle error
17703  }
17704  </code>
17705  Remarks:
17706  None.
17707 */
17708 
17709 SYS_STATUS
17711  SYS_MODULE_OBJ object ) ;
17712 // *****************************************************************************
17713 // *****************************************************************************
17714 // Section: SYS DEBUG Console Functions
17715 // *****************************************************************************
17716 // *****************************************************************************
17717 // *****************************************************************************
17718 /* Function:
17719  SYS_DEBUG_Message( const char* message );
17720  Summary:
17721  Prints a message to the console regardless of the system error level.
17722  Description:
17723  This function prints a message to the console regardless of the system
17724  error level. It can be used as an implementation of the SYS_MESSAGE and
17725  SYS_DEBUG_MESSAGE macros.
17726  Precondition:
17727  SYS_DEBUG_Initialize must have returned a valid object handle and the
17728  SYS_DEBUG_Tasks function must be called by the system to complete the
17729  message request.
17730  Parameters:
17731  message - Pointer to a message string to be displayed.
17732  Returns:
17733  None.
17734  Example:
17735  <code>
17736  // In system_config.h:
17737 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
17738 
17739  // In source (.c) files:
17740  SYS_MESSAGE("My Message\n\r");
17741  </code>
17742  Remarks:
17743  Do not call this function directly. Call the SYS_MESSAGE or
17744  SYS_DEBUG_MESSAGE macros instead.
17745 
17746  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
17747  the messages and message function calls from the source code. To access
17748  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
17749  override the definitions of the individual macros.
17750 */
17751 
17752 void
17754  const char * message ) ;
17755 // *****************************************************************************
17756 /* Function:
17757  SYS_DEBUG_Print( const char* format, ... )
17758  Summary:
17759  Formats and prints a message with a variable number of arguments to the
17760  console regardless of the system error level.
17761  Description:
17762  This function formats and prints a message with a variable number of
17763  arguments to the console regardless of the system error level. It can be
17764  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
17765  Precondition:
17766  SYS_DEBUG_Initialize must have returned a valid object handle and the
17767  SYS_DEBUG_Tasks function must be called by the system to complete the
17768  message request.
17769  Parameters:
17770  format - Pointer to a buffer containing the format string for
17771  the message to be displayed.
17772  ... - Zero or more optional parameters to be formated as
17773  defined by the format string.
17774  Returns:
17775  None.
17776  Example:
17777  <code>
17778  // In system_config.h
17779 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
17780 
17781  // In source code
17782  int result;
17783 
17784  result = SomeOperation();
17785  if (result > MAX_VALUE)
17786  {
17787  SYS_PRINT("Result of %d exceeds max value\r\n", result);
17788  }
17789  </code>
17790  Remarks:
17791  The format string and arguments follow the printf convention.
17792 
17793  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
17794  macros instead.
17795 
17796  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
17797  messages and message function calls. To access and utilize the messages,
17798  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
17799  individual macros.
17800 */
17801 
17802 void
17803  SYS_DEBUG_Print (
17804  const char * format ,
17805  ... ) ;
17806 // *****************************************************************************
17807 /* Function:
17808  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
17809  Summary:
17810  Sets the global system error reporting level.
17811  Description:
17812  This function sets the global system error reporting level.
17813 
17814  Precondition:
17815  SYS_DEBUG_Initialize must have returned a valid object handle.
17816  Parameters:
17817  level - The desired system error level.
17818  Returns:
17819  None.
17820  Example:
17821  <code>
17822  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
17823  </code>
17824  Remarks:
17825  None.
17826 */
17827 
17828 void
17830  SYS_ERROR_LEVEL level ) ;
17831 // *****************************************************************************
17832 /* Function:
17833  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
17834  Summary:
17835  Returns the global system Error reporting level.
17836  Description:
17837  This function returns the global System Error reporting level.
17838 
17839  Precondition:
17840  SYS_DEBUG_Initialize must have returned a valid object handle.
17841  Parameters:
17842  None.
17843  Returns:
17844  The global System Error Level.
17845  Example:
17846  <code>
17847  SYS_ERROR_LEVEL level;
17848 
17849  level = SYS_DEBUG_ErrorLevelGet();
17850  </code>
17851  Remarks:
17852  None.
17853 */
17854 
17856  SYS_DEBUG_ErrorLevelGet ( void ) ;
17857 // *****************************************************************************
17858 // *****************************************************************************
17859 // Section: SYS DEBUG Macros
17860 // *****************************************************************************
17861 // *****************************************************************************
17862 // *****************************************************************************
17863 /* Macro:
17864  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
17865  Summary:
17866  Prints a debug message if the specified level is at or below the global
17867  system error level.
17868  Description:
17869  This macro prints a debug message if the specified level is at or below the
17870  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
17871  Precondition:
17872  SYS_DEBUG_Initialize must have returned a valid object handle.
17873  Parameters:
17874  level - The current error level threshold for displaying the message.
17875  message - Pointer to a buffer containing the message to be displayed.
17876  Returns:
17877  None.
17878  Example:
17879  <code>
17880  // In system_config.h
17881 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
17882 
17883  // In library source (.c) code.
17884  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
17885  </code>
17886  Remarks:
17887  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
17888 
17889  The default SYS_DEBUG_MESSAGE macro definition removes the message and
17890  function call from the source code. To access and utilize the message,
17891  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17892  SYS_DEBUG_MESSAGE macro.
17893 */
17894 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
17895 // *****************************************************************************
17896 /* Macro:
17897  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
17898  Summary:
17899  Formats and prints a debug message if the specified level is at or below the
17900  global system error level.
17901  Description:
17902  This function formats and prints a debug message if the specified level is
17903  at or below the global system error level. It can be used to implement the
17904  SYS_DEBUG_PRINT macro.
17905  Precondition:
17906  SYS_DEBUG_Initialize must have returned a valid object handle.
17907  Parameters:
17908  level - The current error level threshold for displaying the message.
17909  format - Pointer to a buffer containing the format string for
17910  the message to be displayed.
17911  ... - Zero or more optional parameters to be formated as
17912  defined by the format string.
17913  Returns:
17914  None.
17915  Example:
17916  <code>
17917  // In system_config.h
17918 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
17919 
17920  // In source code
17921  int result;
17922 
17923  result = SomeOperation();
17924  if (result > MAX_VALUE)
17925  {
17926  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
17927  // Take appropriate action
17928  }
17929  </code>
17930  Remarks:
17931  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
17932 
17933  The default SYS_DEBUG_PRINT macro definition removes the message and
17934  function call from the source code. To access and utilize the message,
17935  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17936  SYS_DEBUG_PRINT macro.
17937 */
17938 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
17939 // DOM-IGNORE-BEGIN
17940 // *****************************************************************************
17941 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
17942  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
17943  (system_config.h) will map the macros below to the appropriate system
17944  console functions.
17945 */
17946 // DOM-IGNORE-END
17947 // *****************************************************************************
17948 /* Macro:
17949  SYS_MESSAGE( const char* message )
17950  Summary:
17951  Prints a message to the console regardless of the system error level.
17952  Description:
17953  This macro is used to print a message to the console regardless of the
17954  system error level. It can be mapped to any desired implementation.
17955  Precondition:
17956  If mapped to the _SYS_MESSAGE function, then the system debug service must
17957  be initialized and running.
17958  Parameters:
17959  message - Pointer to a buffer containing the message string to be
17960  displayed.
17961  Returns:
17962  None.
17963  Example:
17964  <code>
17965  // In system_config.h:
17966 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
17967 
17968  // In source (.c) files:
17969  SYS_MESSAGE("My Message\n\r");
17970  </code>
17971  Remarks:
17972  By default, this macro is defined as nothing, effectively removing all code
17973  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
17974  defined in a way that maps calls to it to the desired implementation (see
17975  example, above).
17976 
17977  This macro can be mapped to the system console service (along with other
17978  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
17979  configuration (system_config.h) instead of defining it individually.
17980 */
17981 #define SYS_MESSAGE( message )
17982 // *****************************************************************************
17983 /* Function:
17984  SYS_DEBUG_MESSAGE( const char* message )
17985  Summary:
17986  Prints a debug message if the system error level is defined defined at
17987  or lower than the level specified.
17988  Description:
17989  This function prints a debug message if the system error level is defined at
17990  or lower than the level specified.
17991  Precondition:
17992  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
17993  Parameters:
17994  level - The current error level threshold for displaying the message.
17995  message - Pointer to a buffer containing the message to be displayed.
17996  Returns:
17997  None.
17998  Example:
17999  <code>
18000 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
18001  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
18002  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
18003  </code>
18004  Remarks:
18005  By default, this macro is defined as nothing, effectively removing all code
18006  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18007  must be defined in a way that maps calls to it to the desired implementation
18008  (see example, above).
18009 
18010  This macro can be mapped to the system console service (along with other
18011  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18012  configuration (system_config.h) instead of defining it individually.
18013 */
18014 #define SYS_DEBUG_MESSAGE( level , message )
18015 // *****************************************************************************
18016 /* Function:
18017  SYS_PRINT(const char* format, ...);
18018  Summary:
18019  Formats and prints an error message with a variable number of arguments
18020  regardless of the system error level.
18021  Description:
18022  This function formats and prints an error message with a variable number of
18023  if the system error level is defined at or lower than the level specified.
18024  Precondition:
18025  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18026  Parameters:
18027  format - Pointer to a buffer containing the format string for
18028  the message to be displayed.
18029  ... - Zero or more optional parameters to be formated as
18030  defined by the format string.
18031  Returns:
18032  None.
18033  Example:
18034  <code>
18035  // In system_config.h
18036 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18037 
18038  // In source code
18039  int result;
18040 
18041  result = SomeOperation();
18042  if (result > MAX_VALUE)
18043  {
18044  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18045  // Take appropriate action
18046  }
18047  </code>
18048  Remarks:
18049  The format string and arguments follow the printf convention. This function
18050  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18051 
18052  By default, this macro is defined as nothing, effectively removing all code
18053  generated by calls to it. To process SYS_PRINT calls, this macro must be
18054  defined in a way that maps calls to it to the desired implementation (see
18055  example, above).
18056 
18057  This macro can be mapped to the system console service (along with other
18058  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18059  configuration (system_config.h) instead of defining it individually.
18060 */
18061 #define SYS_PRINT( fmt ,... )
18062 // *****************************************************************************
18063 /* Macro:
18064  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18065  Summary:
18066  Formats and prints an error message if the system error level is defined at
18067  or lower than the level specified.
18068  Description:
18069  This macro formats and prints an error message if the system error level
18070  is defined at or lower than the level specified.o
18071  Precondition:
18072  SYS_DEBUG_Initialize must have returned a valid object handle.
18073  Parameters:
18074  level - The current error level threshold for displaying the message.
18075  format - Pointer to a buffer containing the format string for
18076  the message to be displayed.
18077  ... - Zero or more optional parameters to be formated as
18078  defined by the format string.
18079  Returns:
18080  None.
18081  Example:
18082  <code>
18083  // In system_config.h
18084 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18085 
18086  // In source code
18087  int result;
18088 
18089  result = SomeOperation();
18090  if (result > MAX_VALUE)
18091  {
18092  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18093  // Take appropriate action
18094  }
18095  </code>
18096  Remarks:
18097  The format string and arguments follow the printf convention. This function
18098  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18099 
18100  By default, this macro is defined as nothing, effectively removing all code
18101  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18102  defined in a way that maps calls to it to the desired implementation (see
18103  example, above).
18104 
18105  This macro can be mapped to the system console service (along with other
18106  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18107  configuration (system_config.h) instead of defining it individually.
18108 */
18109 #define SYS_DEBUG_PRINT( level , fmt ,... )
18110 // *****************************************************************************
18111 /* Macro:
18112  SYS_DEBUG_BreakPoint( void )
18113  Summary:
18114  Inserts a software breakpoint instruction when building in Debug mode.
18115  Description:
18116  This macro inserts a software breakpoint instruction when building in Debug
18117  mode.
18118  Precondition:
18119  None.
18120  Parameters:
18121  None.
18122  Returns:
18123  None.
18124  Example:
18125  <code>
18126  if (myDebugTestFailed)
18127  {
18128  SYS_DEBUG_BreakPoint();
18129  }
18130  </code>
18131  Remarks:
18132  Compiles out if not built for debugging.
18133 */
18134 #define SYS_DEBUG_BreakPoint( )
18135 // *****************************************************************************
18136 // *****************************************************************************
18137 // Section: SYS DEBUG Deprecated Macros
18138 // *****************************************************************************
18139 // *****************************************************************************
18140 /* Do not use these macros for new development.
18141 */
18142 //DOM-IGNORE-BEGIN
18143 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18144 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18145 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18146 //DOM-IGNORE-END
18147  // _SYS_DEBUG_H
18148 /*******************************************************************************
18149  End of File
18150 */
18151 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18152 /* CLOSE_FILE Include File */
18153 
18154 // DOM-IGNORE-BEGIN
18155 // DOM-IGNORE-END
18156 // *****************************************************************************
18157 // *****************************************************************************
18158 // Section: Data Type Definitions
18159 // *****************************************************************************
18160 // *****************************************************************************
18161 /* USART FIFO+RX(8+1) size */
18162 #define _DRV_USART_RX_DEPTH 9
18163 // *****************************************************************************
18164 /* USART Static Driver Instance Object
18165  Summary:
18166  Object used to keep any data required for the static USART driver.
18167  Description:
18168  This object is used to keep track of any data that must be maintained to
18169  manage the USART static driver.
18170  Remarks:
18171  None.
18172 */
18173 
18174 typedef
18175  struct
18176  {
18177  /* Client specific error */
18178  DRV_USART_ERROR error ;
18179  } DRV_USART_OBJ ;
18180 // *****************************************************************************
18181 // *****************************************************************************
18182 // Section: Local functions.
18183 // *****************************************************************************
18184 // *****************************************************************************
18185 // DOM-IGNORE-BEGIN
18186 // DOM-IGNORE-END
18187  //#ifndef _DRV_USART_STATIC_LOCAL_H
18188 /*******************************************************************************
18189  End of File
18190 */
18191 
18192 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18193 /* CLOSE_FILE Include File */
18194 
18195 // DOM-IGNORE-BEGIN
18196 // DOM-IGNORE-END
18197 // *********************************************************************************************
18198 // *********************************************************************************************
18199 // Section: System Interface Headers for the Instance 0 of USART static driver
18200 // *********************************************************************************************
18201 // *********************************************************************************************
18202 
18203 SYS_MODULE_OBJ
18204  DRV_USART0_Initialize ( void ) ;
18205 
18206 void
18207  DRV_USART0_Deinitialize ( void ) ;
18208 
18209 SYS_STATUS
18210  DRV_USART0_Status ( void ) ;
18211 
18212 void
18213  DRV_USART0_TasksTransmit ( void ) ;
18214 
18215 void
18216  DRV_USART0_TasksReceive ( void ) ;
18217 
18218 void
18219  DRV_USART0_TasksError ( void ) ;
18220 // *********************************************************************************************
18221 // *********************************************************************************************
18222 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18223 // *********************************************************************************************
18224 // *********************************************************************************************
18225 
18226 DRV_HANDLE
18227  DRV_USART0_Open (
18228  const SYS_MODULE_INDEX index ,
18229  const DRV_IO_INTENT ioIntent ) ;
18230 
18231 void
18232  DRV_USART0_Close ( void ) ;
18233 
18235  DRV_USART0_ClientStatus ( void ) ;
18236 
18238  DRV_USART0_TransferStatus ( void ) ;
18239 
18241  DRV_USART0_ErrorGet ( void ) ;
18242 // *********************************************************************************************
18243 // *********************************************************************************************
18244 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18245 // *********************************************************************************************
18246 // *********************************************************************************************
18247 
18248 uint8_t
18249  DRV_USART0_ReadByte ( void ) ;
18250 
18251 void
18253  const uint8_t byte ) ;
18254 
18255 unsigned int
18257 
18258 unsigned int
18260 
18261 bool
18263 
18264 bool
18266 // *********************************************************************************************
18267 // *********************************************************************************************
18268 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18269 // *********************************************************************************************
18270 // *********************************************************************************************
18271 
18274  uint32_t baud ) ;
18275 
18278  DRV_USART_LINE_CONTROL lineControlMode ) ;
18279 // DOM-IGNORE-BEGIN
18280 // DOM-IGNORE-END
18281  // #ifndef _DRV_USART_STATIC_H
18282 /*******************************************************************************
18283  End of File
18284 */
18285 
18286 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18287 /* CLOSE_FILE Include File */
18288 
18289 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18290 /*******************************************************************************
18291  Ports System Service Interface Definition
18292  Company:
18293  Microchip Technology Inc.
18294  File Name:
18295  sys_ports.h
18296  Summary:
18297  Ports System Service interface definitions
18298  Description:
18299  This file contains the interface definition for the Ports system
18300  service. It provides a way to interact with the Ports subsystem to
18301  manage the timing requests supported by the system
18302 *******************************************************************************/
18303 //DOM-IGNORE-BEGIN
18304 /*******************************************************************************
18305 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18306 Microchip licenses to you the right to use, modify, copy and distribute
18307 Software only when embedded on a Microchip microcontroller or digital signal
18308 controller that is integrated into your product or third party product
18309 (pursuant to the sublicense terms in the accompanying license agreement).
18310 You should refer to the license agreement accompanying this Software for
18311 additional information regarding your rights and obligations.
18312 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18313 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18314 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18315 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18316 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18317 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18318 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18319 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18320 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18321 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18322 *******************************************************************************/
18323 //DOM-IGNORE-END
18324 #ifndef _SYS_PORTS_H
18325 #define _SYS_PORTS_H
18326 // *****************************************************************************
18327 // *****************************************************************************
18328 // Section: Included Files
18329 // *****************************************************************************
18330 // *****************************************************************************
18331 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18332 /*******************************************************************************
18333  PORTS System Service Library Interface Definition
18334  Company:
18335  Microchip Technology Inc.
18336  File Name:
18337  sys_ports_definitions.h
18338  Summary:
18339  PORTS System Service data type definitions header.
18340  Description:
18341  This file contains data type definitions header.
18342 *******************************************************************************/
18343 //DOM-IGNORE-BEGIN
18344 /*******************************************************************************
18345 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18346 Microchip licenses to you the right to use, modify, copy and distribute
18347 Software only when embedded on a Microchip microcontroller or digital signal
18348 controller that is integrated into your product or third party product
18349 (pursuant to the sublicense terms in the accompanying license agreement).
18350 You should refer to the license agreement accompanying this Software for
18351 additional information regarding your rights and obligations.
18352 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18353 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18354 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18355 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18356 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18357 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18358 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18359 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18360 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18361 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18362 *******************************************************************************/
18363 //DOM-IGNORE-END
18364 #ifndef _SYS_PORTS_DEFINITIONS_H
18365 #define _SYS_PORTS_DEFINITIONS_H
18366 // *****************************************************************************
18367 // *****************************************************************************
18368 // Section: File includes
18369 // *****************************************************************************
18370 // *****************************************************************************
18371 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18372 #include "system/common/sys_common.h"
18373 #include "system/common/sys_module.h"
18374 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18375 /*******************************************************************************
18376  Ports Peripheral Library Interface Header
18377  Company:
18378  Microchip Technology Inc.
18379  File Name:
18380  plib_ports.h
18381  Summary:
18382  Ports Peripheral Library Interface header for Ports function definitions.
18383  Description:
18384  This header file contains the function prototypes and definitions of
18385  the data types and constants that make up the interface to the Ports
18386  Peripheral Library for all families of Microchip microcontrollers. The
18387  definitions in this file are common to the Ports peripheral.
18388 *******************************************************************************/
18389 // DOM-IGNORE-BEGIN
18390 /*******************************************************************************
18391 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18392 Microchip licenses to you the right to use, modify, copy and distribute
18393 Software only when embedded on a Microchip microcontroller or digital signal
18394 controller that is integrated into your product or third party product
18395 (pursuant to the sublicense terms in the accompanying license agreement).
18396 You should refer to the license agreement accompanying this Software for
18397 additional information regarding your rights and obligations.
18398 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18399 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18400 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18401 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18402 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18403 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18404 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18405 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18406 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18407 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18408 *******************************************************************************/
18409 // DOM-IGNORE-END
18410 #ifndef _PLIB_PORTS_H
18411 #define _PLIB_PORTS_H
18412 #include <stdint.h>
18413 #include <stddef.h>
18414 // DOM-IGNORE-BEGIN
18415 // DOM-IGNORE-END
18416 // *****************************************************************************
18417 // *****************************************************************************
18418 // Section: Constants & Data Types
18419 // *****************************************************************************
18420 // *****************************************************************************
18421 // *****************************************************************************
18422 /* Ports data mask definition
18423  Summary:
18424  Data type defining the Ports data mask
18425  Description:
18426  This data type defines the Ports data mask
18427  Remarks:
18428  None.
18429 */
18430 
18431 typedef
18432 uint16_t
18434 // *****************************************************************************
18435 /* Ports data type definition
18436  Summary:
18437  Data type defining the Ports data type.
18438  Description:
18439  This data type defines the Ports data type.
18440  Remarks:
18441  None.
18442 */
18443 
18444 typedef
18445 uint32_t
18447 // *****************************************************************************
18448 // *****************************************************************************
18449 // Section: Included Files (continued at end of file)
18450 // *****************************************************************************
18451 // *****************************************************************************
18452 /* This section lists the other files that are included in this file. However,
18453  please see the end of the file for additional implementation header files
18454  that are also included.
18455 */
18456 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18457 //DOM-IGNORE-BEGIN
18458 /*******************************************************************************
18459 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18460 Microchip licenses to you the right to use, modify, copy and distribute
18461 Software only when embedded on a Microchip microcontroller or digital signal
18462 controller that is integrated into your product or third party product
18463 (pursuant to the sublicense terms in the accompanying license agreement).
18464 You should refer to the license agreement accompanying this Software for
18465 additional information regarding your rights and obligations.
18466 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18467 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18468 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18469 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18470 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18471 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18472 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18473 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18474 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18475 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18476  *******************************************************************************/
18477 //DOM-IGNORE-END
18478 #ifndef _PLIB_PORTS_PROCESSOR_H
18479 #define _PLIB_PORTS_PROCESSOR_H
18480 #error "Can't find header"
18481 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18482 /* CLOSE_FILE Include File */
18483 
18484 // *****************************************************************************
18485 // *****************************************************************************
18486 // Section: Ports Peripheral Library Interface Routines
18487 // *****************************************************************************
18488 // *****************************************************************************
18489 // *****************************************************************************
18490 /* Function:
18491  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18492  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18493  PORTS_REMAP_INPUT_PIN remapInputPin );
18494  Summary:
18495  Input function remapping.
18496  Description:
18497  This function controls the Input function remapping. It allows user to map
18498  any of the input functionality on any of the remappable input pin.
18499  This function does not perform atomic register access.
18500  Precondition:
18501  IOLOCK bit of configuration register should be clear to allow any remapping.
18502  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18503  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18504  find more information.
18505  Parameters:
18506  index - Identifier for the device instance to be configured
18507  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18508  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18509  Returns:
18510  None.
18511  Example:
18512  <code>
18513 
18514  // System Unlock
18515  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18516  // Unlock PPS registers
18517  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18518  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18519  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18520  </code>
18521  Remarks:
18522  This feature may not be available on all devices. Please refer to the
18523  specific device data sheet to determine availability or use
18524  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18525  this feature is available.
18526 */
18527 
18528 void
18530  PORTS_MODULE_ID index ,
18531  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18532  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18533 // *****************************************************************************
18534 /* Function:
18535  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18536  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18537  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18538  Summary:
18539  Output function remapping.
18540  Description:
18541  This function controls the Output function remapping. it allows user to map
18542  any of the output functionality on any of the remappable output pin.
18543  This function does not perform atomic register access.
18544  Precondition:
18545  IOLOCK bit of configuration register should be clear to allow any remapping.
18546  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18547  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18548  find more information.
18549  Parameters:
18550  index - Identifier for the device instance to be configured
18551  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
18552  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
18553  Returns:
18554  None.
18555  Example:
18556  <code>
18557 
18558  // System Unlock
18559  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18560  // Unlock PPS registers
18561  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18562  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
18563  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
18564 
18565  </code>
18566  Remarks:
18567  This feature may not be available on all devices. Please refer to the
18568  specific device data sheet to determine availability or use
18569  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18570  this feature is available.
18571 */
18572 
18573 void
18575  PORTS_MODULE_ID index ,
18576  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
18577  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
18578 // *****************************************************************************
18579 /* Function:
18580  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
18581  PORTS_ANALOG_PIN pin,
18582  PORTS_PIN_MODE mode );
18583  Summary:
18584  Enables the selected pin as analog or digital.
18585  Description:
18586  This function enables the selected pin as analog or digital.
18587  This function does not perform atomic register access.
18588  Precondition:
18589  None.
18590  Parameters:
18591  index - Identifier for the device instance to be configured
18592  pin - Possible values of PORTS_ANALOG_PIN
18593  mode - Possible values of PORTS_PIN_MODE
18594  Returns:
18595  None.
18596  Example:
18597  <code>
18598 
18599  // Make AN0 pin as Analog
18600  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
18601 
18602  </code>
18603  Remarks:
18604  This feature may not be available on all devices. Please refer to the
18605  specific device data sheet to determine availability or use
18606  PLIB_PORTS_ExistsPinMode in your application to determine whether
18607  this feature is available.
18608 */
18609 
18610 void
18612  PORTS_MODULE_ID index ,
18613  PORTS_ANALOG_PIN pin ,
18614  PORTS_PIN_MODE mode ) ;
18615 // *****************************************************************************
18616 /* Function:
18617  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
18618  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
18619  PORTS_PIN_MODE mode );
18620  Summary:
18621  Enables the selected port pin as analog or digital.
18622  Description:
18623  This function enables the selected port pin as analog or digital.
18624  This function does not perform atomic register access.
18625  Precondition:
18626  None.
18627  Parameters:
18628  index - Identifier for the device instance to be configured
18629  channel - Port pin channel
18630  bitPos - Position in the PORT pins
18631  mode - Possible values of PORTS_PIN_MODE
18632  Returns:
18633  None.
18634  Example:
18635  <code>
18636 
18637  // Make RC5 pin Analog
18638  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
18639  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
18640 
18641  </code>
18642  Remarks:
18643  This function is only available in devices with PPS. For Non-PPS devices, use the
18644  PLIB_PORTS_PinModeSelect function.
18645 
18646  This feature may not be available on all devices. Please refer to the
18647  specific device data sheet to determine availability or use
18648  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
18649  this feature is available.
18650 */
18651 
18652 void
18654  PORTS_MODULE_ID index ,
18655  PORTS_CHANNEL channel ,
18656  PORTS_BIT_POS bitPos ,
18657  PORTS_PIN_MODE mode ) ;
18658 // *****************************************************************************
18659 /* Function:
18660  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
18661  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18662  Summary:
18663  Enables the pull-down for selected Change Notice pins.
18664  Description:
18665  This function enables the pull-down for selected Change Notice pins.
18666  This function does not perform atomic register access.
18667  Precondition:
18668  None.
18669  Parameters:
18670  index - Identifier for the device instance to be configured
18671  channel - Port pin channel
18672  bitPos - Position in the PORT pins
18673  Returns:
18674  None.
18675  Example:
18676  <code>
18677 
18678  // Enable pull-down for RC5 pin
18679  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18680  PORTS_BIT_POS_5);
18681 
18682  </code>
18683  Remarks:
18684  This feature may not be available on all devices. Please refer to the
18685  specific device data sheet to determine availability or use
18686  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18687  determine whether this feature is available.
18688 */
18689 
18690 void
18692  PORTS_MODULE_ID index ,
18693  PORTS_CHANNEL channel ,
18694  PORTS_BIT_POS bitPos ) ;
18695 // *****************************************************************************
18696 /* Function:
18697  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
18698  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18699  Summary:
18700  Disables the pull-down for selected Change Notice pins.
18701  Description:
18702  This function disables the pull-down for selected Change Notice pins.
18703  This function does not perform atomic register access.
18704  Precondition:
18705  None.
18706  Parameters:
18707  index - Identifier for the device instance to be configured
18708  channel - Port pin channel
18709  bitPos - Position in the PORT pins
18710  Returns:
18711  None.
18712  Example:
18713  <code>
18714 
18715  // Disable pull-down for RC5 pin
18716  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18717  PORTS_BIT_POS_5);
18718  </code>
18719  Remarks:
18720  This feature may not be available on all devices. Please refer to the
18721  specific device data sheet to determine availability or use
18722  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18723  determine whether this feature is available.
18724 */
18725 
18726 void
18728  PORTS_MODULE_ID index ,
18729  PORTS_CHANNEL channel ,
18730  PORTS_BIT_POS bitPos ) ;
18731 // *****************************************************************************
18732 /* Function:
18733  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
18734  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18735  Summary:
18736  Enables the pull-up for selected Change Notice pins.
18737  Description:
18738  This function enables the pull-up for selected Change Notice pins.
18739  This function does not perform atomic register access.
18740  Precondition:
18741  None.
18742  Parameters:
18743  index - Identifier for the device instance to be configured
18744  channel - Port pin channel
18745  bitPos - Position in the PORT pins
18746  Returns:
18747  None.
18748  Example:
18749  <code>
18750 
18751  // Enable pull-up for RC5 pin
18752  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18753  PORTS_BIT_POS_5);
18754  </code>
18755  Remarks:
18756  This function is only available in devices with PPS. For Non-PPS devices, use the
18757  PLIB_PORTS_ChangeNoticePullUpEnable function.
18758 
18759  This feature may not be available on all devices. Please refer to the
18760  specific device data sheet to determine availability or use
18761  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18762  determine whether this feature is available.
18763 */
18764 
18765 void
18767  PORTS_MODULE_ID index ,
18768  PORTS_CHANNEL channel ,
18769  PORTS_BIT_POS bitPos ) ;
18770 // *****************************************************************************
18771 /* Function:
18772  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
18773  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
18774  Summary:
18775  Disables weak pull-up for the selected pin.
18776  Description:
18777  This function disables weak pull-up for the selected port pin.
18778  This function does not perform atomic register access.
18779  Precondition:
18780  None.
18781  Parameters:
18782  index - Identifier for the device instance to be configured
18783  channel - Port pin channel
18784  bitPos - Position in the PORT pins
18785  Returns:
18786  None.
18787  Example:
18788  <code>
18789 
18790  // Disable pull-up for RC5 pin
18791  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18792  PORTS_BIT_POS_5);
18793 
18794  </code>
18795  Remarks:
18796  This function is only available in devices with PPS. For Non-PPS devices, use the
18797  PLIB_PORTS_ChangeNoticePullUpDisable function.
18798 
18799  Pull-ups on change notification pins should always be disabled when the
18800  port pin is configured as a digital output.
18801 
18802  This feature may not be available on all devices. Please refer to the
18803  specific device data sheet to determine availability or use
18804  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18805  determine whether this feature is available.
18806 */
18807 
18808 void
18810  PORTS_MODULE_ID index ,
18811  PORTS_CHANNEL channel ,
18812  PORTS_BIT_POS bitPos ) ;
18813 // *****************************************************************************
18814 /* Function:
18815  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
18816  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18817  Summary:
18818  Enables CN interrupt for the selected pin.
18819  Description:
18820  This function enables Change Notice interrupt for the selected port pin.
18821  This function does not perform atomic register access.
18822 
18823  Precondition:
18824  None.
18825  Parameters:
18826  index - Identifier for the device instance to be configured
18827  channel - Port pin channel
18828  bitPos - Position in the PORT pins
18829  Returns:
18830  None.
18831  Example:
18832  <code>
18833 
18834  // Enable CN interrupt for RC5 pin
18835  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18836  PORTS_BIT_POS_5);
18837 
18838  </code>
18839  Remarks:
18840  This function is only available in devices with PPS. For Non-PPS devices, use the
18841  PLIB_PORTS_PinChangeNoticeEnable function.
18842 
18843  This feature may not be available on all devices. Please refer to the
18844  specific device data sheet to determine availability or use
18845  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18846  determine whether this feature is available.
18847 */
18848 
18849 void
18851  PORTS_MODULE_ID index ,
18852  PORTS_CHANNEL channel ,
18853  PORTS_BIT_POS bitPos ) ;
18854 // *****************************************************************************
18855 /* Function:
18856  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
18857  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18858  Summary:
18859  Disables CN interrupt for the selected pin.
18860  Description:
18861  This function disables Change Notice interrupt for the selected port pin.
18862  This function does not perform atomic register access.
18863  Precondition:
18864  None.
18865  Parameters:
18866  index - Identifier for the device instance to be configured
18867  channel - Port pin channel
18868  bitPos - Position in the PORT pins
18869  Returns:
18870  None.
18871  Example:
18872  <code>
18873 
18874  // Disable CN interrupt for RC5 pin
18875  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18876  PORTS_BIT_POS_5);
18877 
18878  </code>
18879  Remarks:
18880  This function is only available in devices with PPS. For Non-PPS devices, use the
18881  PLIB_PORTS_PinChangeNoticeDisable function.
18882 
18883  This feature may not be available on all devices. Please refer to the
18884  specific device data sheet to determine availability or use
18885  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18886  determine whether this feature is available.
18887 */
18888 
18889 void
18891  PORTS_MODULE_ID index ,
18892  PORTS_CHANNEL channel ,
18893  PORTS_BIT_POS bitPos ) ;
18894 // *****************************************************************************
18895 /* Function:
18896  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
18897  PORTS_CHANNEL channel );
18898  Summary:
18899  Enables the change notification for selected port.
18900  Description:
18901  This function enables the change notification for selected port.
18902  This function does not perform atomic register access.
18903  Precondition:
18904  None.
18905  Parameters:
18906  index - Identifier for the device instance to be configured
18907  channel - Port pin channel
18908  Returns:
18909  None.
18910  Example:
18911  <code>
18912  // Enable Change notification for Port C
18913  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
18914 
18915  </code>
18916  Remarks:
18917  This function is only available in devices with PPS. For Non-PPS devices, use the
18918  PLIB_PORTS_ChangeNoticeEnable function.
18919 
18920  This feature may not be available on all devices. Please refer to the
18921  specific device data sheet to determine availability or use
18922  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18923  whether this feature is available.
18924 */
18925 
18926 void
18928  PORTS_MODULE_ID index ,
18929  PORTS_CHANNEL channel ) ;
18930 // *****************************************************************************
18931 /* Function:
18932  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
18933  PORTS_CHANNEL channel );
18934  Summary:
18935  Disables the change notification for selected port.
18936  Description:
18937  This function disables the change notification for selected port.
18938  This function does not perform atomic register access.
18939  Precondition:
18940  None.
18941  Parameters:
18942  index - Identifier for the device instance to be configured
18943  channel - Port pin channel
18944  Returns:
18945  None.
18946  Example:
18947  <code>
18948  // Disable Change notification for Port C
18949  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
18950 
18951  </code>
18952  Remarks:
18953  This function is only available in devices with PPS. For Non-PPS devices, use the
18954  PLIB_PORTS_ChangeNoticeDisable function.
18955 
18956  This feature may not be available on all devices. Please refer to the
18957  specific device data sheet to determine availability or use
18958  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18959  whether this feature is available.
18960 */
18961 
18962 void
18964  PORTS_MODULE_ID index ,
18965  PORTS_CHANNEL channel ) ;
18966 // *****************************************************************************
18967 /* Function:
18968  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
18969  PORTS_CHANNEL channel );
18970  Summary:
18971  Allows CN to be working in Idle mode for selected channel.
18972  Description:
18973  This function makes sure that change notification feature keeps working in
18974  Idle mode for the selected channel.
18975  This function does not perform atomic register access.
18976  Precondition:
18977  None.
18978  Parameters:
18979  index - Identifier for the device instance to be configured
18980  channel - Port pin channel
18981  Returns:
18982  None.
18983  Example:
18984  <code>
18985 
18986  // Change notification continues working in Idle mode for Port C
18987  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
18988 
18989  </code>
18990  Remarks:
18991  This function is only available in devices with PPS. For Non-PPS devices, use the
18992  PLIB_PORTS_ChangeNoticeInIdleEnable function.
18993 
18994  This feature may not be available on all devices. Please refer to the
18995  specific device data sheet to determine availability or use
18996  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
18997  whether this feature is available.
18998 */
18999 
19000 void
19002  PORTS_MODULE_ID index ,
19003  PORTS_CHANNEL channel ) ;
19004 // *****************************************************************************
19005 /* Function:
19006  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19007  PORTS_CHANNEL channel );
19008  Summary:
19009  Change Notification halts in Idle mode for selected channel.
19010  Description:
19011  This function makes sure that change notification feature halts in
19012  Idle mode for the selected channel.
19013  This function does not perform atomic register access.
19014  Precondition:
19015  None.
19016  Parameters:
19017  index - Identifier for the device instance to be configured
19018  channel - Port pin channel
19019  Returns:
19020  None.
19021  Example:
19022  <code>
19023 
19024  // Change notification halts in Idle mode for Port C
19025  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19026 
19027  </code>
19028  Remarks:
19029  This function is only available in devices with PPS. For Non-PPS devices, use the
19030  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19031 
19032  This feature may not be available on all devices. Please refer to the
19033  specific device data sheet to determine availability or use
19034  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19035  whether this feature is available.
19036 */
19037 
19038 void
19040  PORTS_MODULE_ID index ,
19041  PORTS_CHANNEL channel ) ;
19042 // *****************************************************************************
19043 /* Function:
19044  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19045  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19046  Summary:
19047  checks the status of change on the pin
19048  Description:
19049  This function checks if the change has occurred on the given pin or not.
19050  This function does not perform atomic register access.
19051  Precondition:
19052  None.
19053  Parameters:
19054  index - Identifier for the device instance to be configured
19055  channel - Port pin channel
19056  bitPos - Position in the PORT pins
19057  Returns:
19058  None.
19059  Example:
19060  <code>
19061 
19062  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19063  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19064  {
19065  //do something
19066  }
19067 
19068  </code>
19069  Remarks:
19070  This feature may not be available on all devices. Please refer to the
19071  specific device data sheet to determine availability or use
19072  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19073  whether this feature is available.
19074 */
19075 
19076 bool
19078  PORTS_MODULE_ID index ,
19079  PORTS_CHANNEL channel ,
19080  PORTS_BIT_POS bitPos ) ;
19081 // *****************************************************************************
19082 /* Function:
19083  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19084  PORTS_BIT_POS bitPos )
19085  Summary:
19086  Reads/Gets data from the selected digital pin.
19087  Description:
19088  This function reads/gets data from the selected digital PORT i/o pin.
19089  This function should be used to read the live data at the pin.
19090  This function does not perform atomic register access.
19091 
19092  Precondition:
19093  None.
19094  Parameters:
19095  index - Identifier for the device instance to be configured
19096  channel - Identifier for the Ports channel A, B, C, etc.
19097  bitPos - Possible values of PORTS_BIT_POS
19098  Returns:
19099  Port pin read data.
19100  Example:
19101  <code>
19102  // read port pin RC4
19103  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19104  PORTS_BIT_POS_4);
19105  </code>
19106  Remarks:
19107  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19108 
19109  This feature may not be available on all devices. Please refer to the
19110  specific device data sheet to determine availability or use
19111  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19112  this feature is available.
19113 */
19114 
19115 bool
19117  PORTS_MODULE_ID index ,
19118  PORTS_CHANNEL channel ,
19119  PORTS_BIT_POS bitPos ) ;
19120 // *****************************************************************************
19121 /* Function:
19122  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19123  PORTS_BIT_POS bitPos )
19124  Summary:
19125  Reads/Gets data from the selected latch.
19126  Description:
19127  This function reads/gets data from the selected PORTx Data Latch, not from
19128  the port I/O pins.
19129  This function does not perform atomic register access.
19130 
19131  Precondition:
19132  None.
19133  Parameters:
19134  index - Identifier for the device instance to be configured
19135  channel - Identifier for the Ports channel A, B, C, etc.
19136  bitPos - Possible values of PORTS_BIT_POS
19137  Returns:
19138  Latch read data.
19139  Example:
19140  <code>
19141  // read latch RC4
19142  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19143  PORTS_BIT_POS_4);
19144  </code>
19145  Remarks:
19146  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19147  should be used.
19148 
19149  This feature may not be available on all devices. Please refer to the
19150  specific device data sheet to determine availability or use
19151  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19152  this feature is available.
19153 */
19154 
19155 bool
19157  PORTS_MODULE_ID index ,
19158  PORTS_CHANNEL channel ,
19159  PORTS_BIT_POS bitPos ) ;
19160 // *****************************************************************************
19161 /* Function:
19162  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19163  PORTS_BIT_POS bitPos,
19164  bool value )
19165  Summary:
19166  Writes the selected digital pin/latch.
19167  Description:
19168  This function writes to the selected digital pin/latch.
19169  This function does not perform atomic register access.
19170  Precondition:
19171  None.
19172  Parameters:
19173  index - Identifier for the device instance to be configured
19174  channel - Identifier for the Ports channel A, B, C, etc.
19175  bitPos - Possible values of PORTS_BIT_POS
19176  value - Value to be written to the specific pin/latch
19177  true - sets the bit, false - clears the bit
19178  Returns:
19179  None.
19180  Example:
19181  <code>
19182 
19183  // write 'one' in port RC4
19184  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19185 
19186  </code>
19187  Remarks:
19188  This feature may not be available on all devices. Please refer to the
19189  specific device data sheet to determine availability or use
19190  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19191  this feature is available.
19192 */
19193 
19194 void
19196  PORTS_MODULE_ID index ,
19197  PORTS_CHANNEL channel ,
19198  PORTS_BIT_POS bitPos ,
19199  bool value ) ;
19200 // *****************************************************************************
19201 /* Function:
19202  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19203  PORTS_BIT_POS bitPos )
19204  Summary:
19205  Sets the selected digital pin/latch.
19206  Description:
19207  This function sets the selected digital pin/latch.
19208  This function does not perform atomic register access.
19209  Precondition:
19210  None.
19211  Parameters:
19212  index - Identifier for the device instance to be configured
19213  channel - Identifier for the Ports channel A, B, C, etc.
19214  bitPos - Possible values of PORTS_BIT_POS
19215  Returns:
19216  None.
19217  Example:
19218  <code>
19219 
19220  // Sets port pin RC4
19221  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19222 
19223  </code>
19224  Remarks:
19225  This feature may not be available on all devices. Please refer to the
19226  specific device data sheet to determine availability or use
19227  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19228  this feature is available.
19229 */
19230 
19231 void
19233  PORTS_MODULE_ID index ,
19234  PORTS_CHANNEL channel ,
19235  PORTS_BIT_POS bitPos ) ;
19236 // *****************************************************************************
19237 /* Function:
19238  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19239  PORTS_BIT_POS bitPos )
19240  Summary:
19241  Clears the selected digital pin/latch.
19242  Description:
19243  This function clears the selected digital pin/latch.
19244  This function does not perform atomic register access.
19245  Precondition:
19246  None.
19247  Parameters:
19248  index - Identifier for the device instance to be configured
19249  channel - Identifier for the Ports channel A, B, C, etc.
19250  bitPos - Possible values of PORTS_BIT_POS
19251  Returns:
19252  None.
19253  Example:
19254  <code>
19255 
19256  // Clears port pin RC4
19257  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19258 
19259  </code>
19260  Remarks:
19261  This feature may not be available on all devices. Please refer to the
19262  specific device data sheet to determine availability or use
19263  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19264  this feature is available.
19265 */
19266 
19267 void
19269  PORTS_MODULE_ID index ,
19270  PORTS_CHANNEL channel ,
19271  PORTS_BIT_POS bitPos ) ;
19272 // *****************************************************************************
19273 /* Function:
19274  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19275  PORTS_BIT_POS bitPos )
19276  Summary:
19277  Toggles the selected digital pin/latch.
19278  Description:
19279  This function toggles the selected digital pin/latch.
19280  This function does not perform atomic register access.
19281  Precondition:
19282  None.
19283  Parameters:
19284  index - Identifier for the device instance to be configured
19285  channel - Identifier for the Ports channel A, B, C, etc.
19286  bitPos - Possible values of PORTS_BIT_POS
19287  Returns:
19288  None.
19289  Example:
19290  <code>
19291 
19292  // Toggles port pin RC4
19293  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19294 
19295  </code>
19296  Remarks:
19297  This feature may not be available on all devices. Please refer to the
19298  specific device data sheet to determine availability or use
19299  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19300  this feature is available.
19301 */
19302 
19303 void
19305  PORTS_MODULE_ID index ,
19306  PORTS_CHANNEL channel ,
19307  PORTS_BIT_POS bitPos ) ;
19308 // *****************************************************************************
19309 /* Function:
19310  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19311  PORTS_BIT_POS bitPos )
19312  Summary:
19313  Makes the selected pin direction input
19314  Description:
19315  This function makes the selected pin direction as input
19316  This function does not perform atomic register access.
19317  Precondition:
19318  None.
19319  Parameters:
19320  index - Identifier for the device instance to be configured
19321  channel - Identifier for the Ports channel A, B, C, etc.
19322  bitPos - Possible values of PORTS_BIT_POS direction that has to
19323  be made input
19324  Returns:
19325  None.
19326  Example:
19327  <code>
19328 
19329  // make pin RC4 as input
19330  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19331 
19332  </code>
19333  Remarks:
19334  This feature may not be available on all devices. Please refer to the
19335  specific device data sheet to determine availability or use
19336  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19337  this feature is available.
19338 */
19339 
19340 void
19342  PORTS_MODULE_ID index ,
19343  PORTS_CHANNEL channel ,
19344  PORTS_BIT_POS bitPos ) ;
19345 // *****************************************************************************
19346 /* Function:
19347  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19348  PORTS_BIT_POS bitPos )
19349  Summary:
19350  Makes the selected pin direction output
19351  Description:
19352  This function makes the selected pin direction as output
19353  This function does not perform atomic register access.
19354  Precondition:
19355  None.
19356  Parameters:
19357  index - Identifier for the device instance to be configured
19358  channel - Identifier for the Ports channel A, B, C, etc.
19359  bitPos - Possible values of PORTS_BIT_POS direction that has to
19360  be made output
19361  Returns:
19362  None.
19363  Example:
19364  <code>
19365 
19366  // make pin RC4 as output
19367  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19368 
19369  </code>
19370  Remarks:
19371  This feature may not be available on all devices. Please refer to the
19372  specific device data sheet to determine availability or use
19373  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19374  this feature is available.
19375 */
19376 
19377 void
19379  PORTS_MODULE_ID index ,
19380  PORTS_CHANNEL channel ,
19381  PORTS_BIT_POS bitPos ) ;
19382 // *****************************************************************************
19383 /* Function:
19384  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19385  PORTS_BIT_POS bitPos )
19386  Summary:
19387  Enables the open drain functionality for the selected pin.
19388  Description:
19389  This function enables the open drain functionality for the selected pin.
19390  This function does not perform atomic register access.
19391  Precondition:
19392  None.
19393  Parameters:
19394  index - Identifier for the device instance to be configured
19395  channel - Identifier for the Ports channel A, B, C, etc.
19396  bitPos - Possible values of PORTS_BIT_POS
19397  Returns:
19398  None.
19399  Example:
19400  <code>
19401 
19402  // Enable open drain for pin RC4
19403  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19404 
19405  </code>
19406  Remarks:
19407  This feature may not be available on all devices. Please refer to the
19408  specific device data sheet to determine availability or use
19409  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19410  this feature is available.
19411 */
19412 
19413 void
19415  PORTS_MODULE_ID index ,
19416  PORTS_CHANNEL channel ,
19417  PORTS_BIT_POS bitPos ) ;
19418 // *****************************************************************************
19419 /* Function:
19420  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19421  PORTS_BIT_POS bitPos )
19422  Summary:
19423  Disables the open drain functionality for the selected pin.
19424  Description:
19425  This function disables the open drain functionality for the selected pin.
19426  This function does not perform atomic register access.
19427  Precondition:
19428  None.
19429  Parameters:
19430  index - Identifier for the device instance to be configured
19431  channel - Identifier for the Ports channel A, B, C, etc.
19432  bitPos - One of the possible values of PORTS_BIT_POS.
19433  Returns:
19434  None.
19435  Example:
19436  <code>
19437 
19438  // Disable open drain for pin RC4
19439  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19440 
19441  </code>
19442  Remarks:
19443  This feature may not be available on all devices. Please refer to the
19444  specific device data sheet to determine availability or use
19445  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19446  this feature is available.
19447 */
19448 
19449 void
19451  PORTS_MODULE_ID index ,
19452  PORTS_CHANNEL channel ,
19453  PORTS_BIT_POS bitPos ) ;
19454 // *****************************************************************************
19455 /* Function:
19456  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19457  (
19458  PORTS_MODULE_ID index,
19459  PORTS_CHANNEL channel
19460  )
19461  Summary:
19462  Reads and returns data from the selected Latch.
19463  Description:
19464  This function reads and returns the data from the selected Latch.
19465  This function does not perform atomic register access.
19466 
19467  Precondition:
19468  None.
19469  Parameters:
19470  index - Identifier for the device instance to be configured
19471  channel - Identifier for the Ports channel A, B, C, etc.
19472  Returns:
19473  Latch read data.
19474  Example:
19475  <code>
19476  // Read latch C
19477  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19478 
19479  </code>
19480  Remarks:
19481  For reading the Live data, PLIB_PORTS_Read function should be used.
19482 
19483  This feature may not be available on all devices. Please refer to the
19484  specific device data sheet to determine availability or use
19485  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19486  this feature is available.
19487 */
19488 
19491  PORTS_MODULE_ID index ,
19492  PORTS_CHANNEL channel ) ;
19493 // *****************************************************************************
19494 /* Function:
19495  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19496  Summary:
19497  Reads the selected digital port.
19498  Description:
19499  This function reads from the selected digital port.
19500  This function does not perform atomic register access.
19501  Precondition:
19502  None.
19503  Parameters:
19504  index - Identifier for the device instance to be configured
19505  channel - Identifier for the Ports channel A, B, C, etc.
19506  Returns:
19507  data on a port with width PORTS_DATA_TYPE
19508  Example:
19509  <code>
19510 
19511  // Read PORT C
19512  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19513 
19514  </code>
19515  Remarks:
19516  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19517 
19518  This feature may not be available on all devices. Please refer to the
19519  specific device data sheet to determine availability or use
19520  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19521  this feature is available.
19522 */
19523 
19525  PLIB_PORTS_Read (
19526  PORTS_MODULE_ID index ,
19527  PORTS_CHANNEL channel ) ;
19528 // *****************************************************************************
19529 /* Function:
19530  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19531  PORTS_DATA_TYPE value )
19532  Summary:
19533  Writes the selected digital port/latch.
19534  Description:
19535  This function writes to the selected digital port/latch.
19536  This function does not perform atomic register access.
19537  Precondition:
19538  None.
19539  Parameters:
19540  index - Identifier for the device instance to be configured
19541  channel - Identifier for the Ports channel A, B, C, etc.
19542  value - Value to be written into a port of width PORTS_DATA_TYPE
19543  Returns:
19544  None.
19545  Example:
19546  <code>
19547 
19548  // Write 0x12 into PORT C
19549  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
19550 
19551  </code>
19552  Remarks:
19553  This feature may not be available on all devices. Please refer to the
19554  specific device data sheet to determine availability or use
19555  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19556  this feature is available.
19557 */
19558 
19559 void
19561  PORTS_MODULE_ID index ,
19562  PORTS_CHANNEL channel ,
19563  PORTS_DATA_TYPE value ) ;
19564 // *****************************************************************************
19565 /* Function:
19566  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19567  PORTS_DATA_TYPE value,
19568  PORTS_DATA_MASK mask )
19569  Summary:
19570  Sets the selected bits of the port.
19571  Description:
19572  This function performs an 'AND' operation on the value and mask parameters,
19573  and then sets the bits in the port channel that were set by the result of the
19574  'AND' operation.
19575  This function does not perform atomic register access.
19576  Precondition:
19577  None.
19578  Parameters:
19579  index - Identifier for the device instance to be configured
19580  channel - Identifier for the Ports channel A, B, C, etc.
19581  value - Consists of information about which port bit has to be
19582  set and which not
19583  mask - Identifies the bits which could be intended for setting
19584  Returns:
19585  None.
19586  Example:
19587  <code>
19588 
19589  // MY_VALUE - 0x1234
19590  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
19591 
19592  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
19593  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
19594 
19595  </code>
19596  Remarks:
19597  This feature may not be available on all devices. Please refer to the
19598  specific device data sheet to determine availability or use
19599  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19600  this feature is available.
19601 */
19602 
19603 void
19604  PLIB_PORTS_Set (
19605  PORTS_MODULE_ID index ,
19606  PORTS_CHANNEL channel ,
19607  PORTS_DATA_TYPE value ,
19608  PORTS_DATA_MASK mask ) ;
19609 // *****************************************************************************
19610 /* Function:
19611  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19612  PORTS_DATA_MASK toggleMask )
19613  Summary:
19614  Toggles the selected digital port/latch.
19615  Description:
19616  This function toggles the selected digital port/latch.
19617  This function does not perform atomic register access.
19618  Precondition:
19619  None.
19620  Parameters:
19621  index - Identifier for the device instance to be configured
19622  channel - Identifier for the Ports channel A, B, C, etc.
19623  toggleMask - Identifies the bits to be toggled
19624  Returns:
19625  None.
19626  Example:
19627  <code>
19628 
19629  // Toggles the three least significant Port C bits
19630  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19631 
19632  </code>
19633  Remarks:
19634  This feature may not be available on all devices. Please refer to the
19635  specific device data sheet to determine availability or use
19636  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19637  this feature is available.
19638 */
19639 
19640 void
19642  PORTS_MODULE_ID index ,
19643  PORTS_CHANNEL channel ,
19644  PORTS_DATA_MASK toggleMask ) ;
19645 // *****************************************************************************
19646 /* Function:
19647  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19648  PORTS_DATA_MASK clearMask )
19649  Summary:
19650  Clears the selected digital port/latch bits.
19651  Description:
19652  This function clears the selected digital port/latch bits.
19653  This function does not perform atomic register access.
19654  Precondition:
19655  None.
19656  Parameters:
19657  index - Identifier for the device instance to be configured
19658  channel - Identifier for the Ports channel A, B, C, etc.
19659  clearMask - Identifies the bits to be cleared
19660  Returns:
19661  None.
19662  Example:
19663  <code>
19664 
19665  // Clears the three least significant Port C bits
19666  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19667 
19668  </code>
19669  Remarks:
19670  This feature may not be available on all devices. Please refer to the
19671  specific device data sheet to determine availability or use
19672  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19673  this feature is available.
19674 */
19675 
19676 void
19678  PORTS_MODULE_ID index ,
19679  PORTS_CHANNEL channel ,
19680  PORTS_DATA_MASK clearMask ) ;
19681 // *****************************************************************************
19682 /* Function:
19683  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19684  PORTS_DATA_MASK mask )
19685  Summary:
19686  Makes the selected pins direction input.
19687  Description:
19688  This function makes the selected pins direction input.
19689  This function does not perform atomic register access.
19690 
19691  Precondition:
19692  None.
19693  Parameters:
19694  index - Identifier for the device instance to be configured
19695  channel - Identifier for the Ports channel A, B, C, etc.
19696  mask - Identifies the pins direction that has to be made input
19697  Returns:
19698  None.
19699  Example:
19700  <code>
19701 
19702  // Make RC0, RC1 and RC2 pins as Input
19703  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19704 
19705  </code>
19706  Remarks:
19707  This feature may not be available on all devices. Please refer to the
19708  specific device data sheet to determine availability or use
19709  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19710  this feature is available.
19711 */
19712 
19713 void
19715  PORTS_MODULE_ID index ,
19716  PORTS_CHANNEL channel ,
19717  PORTS_DATA_MASK mask ) ;
19718 // *****************************************************************************
19719 /* Function:
19720  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19721  PORTS_DATA_MASK mask )
19722  Summary:
19723  Makes the selected pins direction output.
19724  Description:
19725  This function makes the selected pins direction output.
19726  This function does not perform atomic register access.
19727  Precondition:
19728  None.
19729  Parameters:
19730  index - Identifier for the device instance to be configured
19731  channel - Identifier for the Ports channel A, B, C, etc.
19732  mask - Identifies the pins direction that has to be made output
19733  Returns:
19734  None.
19735  Example:
19736  <code>
19737 
19738  // Make RC0, RC1 and RC2 pins as Output
19739  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19740 
19741  </code>
19742  Remarks:
19743  This feature may not be available on all devices. Please refer to the
19744  specific device data sheet to determine availability or use
19745  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19746  this feature is available.
19747 */
19748 
19749 void
19751  PORTS_MODULE_ID index ,
19752  PORTS_CHANNEL channel ,
19753  PORTS_DATA_MASK mask ) ;
19754 // *****************************************************************************
19755 /* Function:
19756  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19757  Summary:
19758  Reads the direction of the selected digital port.
19759  Description:
19760  This function reads the direction of the selected digital port.
19761  This function does not perform atomic register access.
19762  Precondition:
19763  None.
19764  Parameters:
19765  index - Identifier for the device instance to be configured
19766  channel - Identifier for the Ports channel A, B, C, etc.
19767  Returns:
19768  Direction of the selected port of type PORTS_DATA_MASK
19769  Example:
19770  <code>
19771 
19772  // Reads the direction of Port C pins
19773  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
19774 
19775  </code>
19776  Remarks:
19777  This feature may not be available on all devices. Please refer to the
19778  specific device data sheet to determine availability or use
19779  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19780  this feature is available.
19781 */
19782 
19785  PORTS_MODULE_ID index ,
19786  PORTS_CHANNEL channel ) ;
19787 // *****************************************************************************
19788 /* Function:
19789  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19790  PORTS_DATA_MASK mask )
19791  Summary:
19792  Enables the open drain functionality for the selected port pins.
19793  Description:
19794  This function enables the open drain functionality for the selected port pins.
19795  This function does not perform atomic register access.
19796  Precondition:
19797  None.
19798  Parameters:
19799  index - Identifier for the device instance to be configured
19800  channel - Identifier for the Ports channel A, B, C, etc.
19801  mask - Identifies the pins for the open drain to be enabled
19802  Returns:
19803  None.
19804  Example:
19805  <code>
19806 
19807  // Enable Open Drain for RC0, RC1 and RC2 pins
19808  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19809 
19810  </code>
19811  Remarks:
19812  This feature may not be available on all devices. Please refer to the
19813  specific device data sheet to determine availability or use
19814  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19815  this feature is available.
19816 */
19817 
19818 void
19820  PORTS_MODULE_ID index ,
19821  PORTS_CHANNEL channel ,
19822  PORTS_DATA_MASK mask ) ;
19823 // *****************************************************************************
19824 /* Function:
19825  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19826  PORTS_DATA_MASK mask )
19827  Summary:
19828  Disables the open drain functionality for the selected port.
19829  Description:
19830  This function disables the open drain functionality for the selected port.
19831  This function does not perform atomic register access.
19832 
19833  Precondition:
19834  None.
19835  Parameters:
19836  index - Identifier for the device instance to be configured
19837  channel - Identifier for the Ports channel A, B, C, etc.
19838  mask - Identifies the pins for the open drain to be disabled
19839  Returns:
19840  None.
19841  Example:
19842  <code>
19843 
19844  // Disable Open Drain for RC0, RC1 and RC2 pins
19845  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19846 
19847  </code>
19848  Remarks:
19849  This feature may not be available on all devices. Please refer to the
19850  specific device data sheet to determine availability or use
19851  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19852  this feature is available.
19853 */
19854 
19855 void
19857  PORTS_MODULE_ID index ,
19858  PORTS_CHANNEL channel ,
19859  PORTS_DATA_MASK mask ) ;
19860 // *****************************************************************************
19861 /* Function:
19862  void PLIB_PORTS_ChannelModeSelect
19863  (
19864  PORTS_MODULE_ID index,
19865  PORTS_CHANNEL channel,
19866  PORTS_DATA_MASK modeMask,
19867  PORTS_PIN_MODE mode
19868  );
19869  Summary:
19870  Enables the selected channel pins as analog or digital.
19871  Description:
19872  This function enables the selected channel pins as analog or digital.
19873  This function does not perform atomic register access.
19874  Precondition:
19875  None.
19876  Parameters:
19877  index - Identifier for the device instance to be configured
19878  channel - Port pin channel
19879  modeMask - Identifies the pins whose mode has to be modified.
19880  Modes of the pins whose corresponding bit is '1' get
19881  modified, mode of the other pins remains the same.
19882  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
19883  Returns:
19884  None.
19885  Example:
19886  <code>
19887 
19888  // Make pins RC5, RC8 and RC13 Analog
19889  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
19890 
19891  </code>
19892  Remarks:
19893  This function is only available in devices with PPS. For Non-PPS devices, use the
19894  PLIB_PORTS_AnPinsModeSelect function.
19895 
19896  This feature may not be available on all devices. Please refer to the
19897  specific device data sheet to determine availability or use
19898  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19899  this feature is available.
19900 */
19901 
19902 void
19904  PORTS_MODULE_ID index ,
19905  PORTS_CHANNEL channel ,
19906  PORTS_DATA_MASK modeMask ,
19907  PORTS_PIN_MODE mode ) ;
19908 // *****************************************************************************
19909 /* Function:
19910  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
19911  (
19912  PORTS_MODULE_ID index,
19913  PORTS_CHANNEL channel,
19914  PORTS_DATA_MASK mask
19915  );
19916  Summary:
19917  Enables Change Notice pull-up for the selected channel pins.
19918  Description:
19919  This function enables the Change Notice pull-up for the selected
19920  channel pins.
19921  This function does not perform atomic register access.
19922  Precondition:
19923  None.
19924  Parameters:
19925  index - Identifier for the device instance to be configured
19926  channel - Port pin channel
19927  mask - Identifies the pins of the pull-up to be enabled
19928  Returns:
19929  None.
19930  Example:
19931  <code>
19932 
19933  // Enable pull-up for RC5, RC8 and RC13 pins
19934  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
19935  0x2120);
19936  </code>
19937  Remarks:
19938  This function is only available in devices with PPS. For Non-PPS devices, use the
19939  PLIB_PORTS_CnPinsPullUpEnable function.
19940 
19941  This feature may not be available on all devices. Please refer to the
19942  specific device data sheet to determine availability or use
19943  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19944  determine whether this feature is available.
19945 */
19946 
19947 void
19949  PORTS_MODULE_ID index ,
19950  PORTS_CHANNEL channel ,
19951  PORTS_DATA_MASK mask ) ;
19952 // *****************************************************************************
19953 /* Function:
19954  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
19955  (
19956  PORTS_MODULE_ID index,
19957  PORTS_CHANNEL channel,
19958  PORTS_DATA_MASK mask
19959  );
19960  Summary:
19961  Disables Change Notice pull-up for the selected channel pins.
19962  Description:
19963  This function Disables the Change Notice pull-up for the selected
19964  channel pins.
19965  PLIB_PORTS_ChannelChangeNoticePullUpDisable
19966  Precondition:
19967  None.
19968  Parameters:
19969  index - Identifier for the device instance to be configured
19970  channel - Port pin channel
19971  mask - Identifies the pins of the pull-up to be disabled
19972  Returns:
19973  None.
19974  Example:
19975  <code>
19976 
19977  // Disable pull-up for RC5, RC8 and RC13 pins
19978  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
19979  0x2120);
19980  </code>
19981  Remarks:
19982  This function is only available in devices with PPS. For Non-PPS devices, use the
19983  PLIB_PORTS_CnPinsPullUpDisable function.
19984 
19985  This feature may not be available on all devices. Please refer to the
19986  specific device data sheet to determine availability or use
19987  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19988  determine whether this feature is available.
19989 */
19990 
19991 void
19993  PORTS_MODULE_ID index ,
19994  PORTS_CHANNEL channel ,
19995  PORTS_DATA_MASK mask ) ;
19996 // *****************************************************************************
19997 /* Function:
19998  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
19999  (
20000  PORTS_MODULE_ID index,
20001  PORTS_CHANNEL channel,
20002  PORTS_DATA_MASK mask
20003  );
20004  Summary:
20005  Enables Change Notice pull-down for the selected channel pins.
20006  Description:
20007  This function enables the Change Notice pull-down for the selected
20008  channel pins.
20009  This function does not perform atomic register access.
20010  Precondition:
20011  None.
20012  Parameters:
20013  index - Identifier for the device instance to be configured
20014  channel - Port pin channel
20015  mask - Identifies the pins for the pull-down to be enabled
20016  Returns:
20017  None.
20018  Example:
20019  <code>
20020 
20021  // Enable pull-down for RC5, RC8 and RC13 pins
20022  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20023  0x2120);
20024  </code>
20025  Remarks:
20026  This feature may not be available on all devices. Please refer to the
20027  specific device data sheet to determine availability or use
20028  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20029  determine whether this feature is available.
20030 */
20031 
20032 void
20034  PORTS_MODULE_ID index ,
20035  PORTS_CHANNEL channel ,
20036  PORTS_DATA_MASK mask ) ;
20037 // *****************************************************************************
20038 /* Function:
20039  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20040  (
20041  PORTS_MODULE_ID index,
20042  PORTS_CHANNEL channel,
20043  PORTS_DATA_MASK mask
20044  );
20045  Summary:
20046  Disables Change Notice pull-down for the selected channel pins.
20047  Description:
20048  This function Disables the Change Notice pull-down for the selected
20049  channel pins.
20050  This function does not perform atomic register access.
20051  Precondition:
20052  None.
20053  Parameters:
20054  index - Identifier for the device instance to be configured
20055  channel - Port pin channel
20056  mask - Identifies the pins for the pull-down to be disabled
20057  Returns:
20058  None.
20059  Example:
20060  <code>
20061 
20062  // Disable pull-down for RC5, RC8 and RC13 pins
20063  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20064  0x2120);
20065  </code>
20066  Remarks:
20067  This feature may not be available on all devices. Please refer to the
20068  specific device data sheet to determine availability or use
20069  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20070  determine whether this feature is available.
20071 */
20072 
20073 void
20075  PORTS_MODULE_ID index ,
20076  PORTS_CHANNEL channel ,
20077  PORTS_DATA_MASK mask ) ;
20078 // *****************************************************************************
20079 /* Function:
20080  void PLIB_PORTS_ChannelChangeNoticeEnable
20081  (
20082  PORTS_MODULE_ID index,
20083  PORTS_CHANNEL channel,
20084  PORTS_DATA_MASK mask
20085  );
20086  Summary:
20087  Enables CN interrupt for the selected pins of a channel.
20088  Description:
20089  This function enables Change Notice interrupt for the selected port
20090  pins of a channel.
20091  This function does not perform atomic register access.
20092  Precondition:
20093  None.
20094  Parameters:
20095  index - Identifier for the device instance to be configured
20096  channel - Port pin channel
20097  mask - Identifies the pins for which change notification is
20098  to be enabled
20099  Returns:
20100  None.
20101  Example:
20102  <code>
20103 
20104  // Enable CN interrupt for RC5, RC8 and RC13 pins
20105  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20106 
20107  </code>
20108  Remarks:
20109  This function is only available in devices with PPS. For Non-PPS devices, use the
20110  PLIB_PORTS_CnPinsEnable function.
20111 
20112  This feature may not be available on all devices. Please refer to the
20113  specific device data sheet to determine availability or use
20114  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20115  determine whether this feature is available.
20116 */
20117 
20118 void
20120  PORTS_MODULE_ID index ,
20121  PORTS_CHANNEL channel ,
20122  PORTS_DATA_MASK mask ) ;
20123 // *****************************************************************************
20124 /* Function:
20125  void PLIB_PORTS_ChannelChangeNoticeDisable
20126  (
20127  PORTS_MODULE_ID index,
20128  PORTS_CHANNEL channel,
20129  PORTS_DATA_MASK mask
20130  );
20131  Summary:
20132  Disables CN interrupt for the selected pins of a channel.
20133  Description:
20134  This function Disables Change Notice interrupt for the selected port
20135  pins of a channel.
20136  This function does not perform atomic register access.
20137  Precondition:
20138  None.
20139  Parameters:
20140  index - Identifier for the device instance to be configured
20141  channel - Port pin channel
20142  mask - Identifies the pins for which change notification is
20143  to be disabled
20144  Returns:
20145  None.
20146  Example:
20147  <code>
20148 
20149  // Disable CN interrupt for RC5, RC8 and RC13 pins
20150  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20151 
20152  </code>
20153  Remarks:
20154  This function is only available in devices with PPS. For Non-PPS devices, use the
20155  PLIB_PORTS_CnPinsDisable function.
20156 
20157  This feature may not be available on all devices. Please refer to the
20158  specific device data sheet to determine availability or use
20159  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20160  determine whether this feature is available.
20161 */
20162 
20163 void
20165  PORTS_MODULE_ID index ,
20166  PORTS_CHANNEL channel ,
20167  PORTS_DATA_MASK mask ) ;
20168 // *****************************************************************************
20169 /* Function:
20170  void PLIB_PORTS_AnPinsModeSelect
20171  (
20172  PORTS_MODULE_ID index,
20173  PORTS_AN_PIN anPins,
20174  PORTS_PIN_MODE mode
20175  );
20176  Summary:
20177  Enables the selected AN pins as analog or digital.
20178  Description:
20179  This function enables the selected AN pins as analog or digital.
20180  This function does not perform atomic register access.
20181  Precondition:
20182  None.
20183  Parameters:
20184  index - Identifier for the device instance to be configured
20185  anPins - AN pins whose mode is to be changed. Multiple AN pins
20186  can be ORed.
20187  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20188  Returns:
20189  None.
20190  Example:
20191  <code>
20192 
20193  // Make pins AN5, AN8 and AN13 Analog
20194  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20195  PORTS_AN_PIN_8 |
20196  PORTS_AN_PIN_13,
20197  PORTS_PIN_MODE_ANALOG);
20198 
20199  </code>
20200  Remarks:
20201  This function is only available in devices without PPS feature. For PPS
20202  devices, use the PLIB_PORTS_ChannelModeSelect function.
20203 
20204  This feature may not be available on all devices. Please refer to the
20205  specific device data sheet to determine availability or use
20206  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20207  this feature is available.
20208 */
20209 
20210 void
20212  PORTS_MODULE_ID index ,
20213  PORTS_AN_PIN anPins ,
20214  PORTS_PIN_MODE mode ) ;
20215 // *****************************************************************************
20216 /* Function:
20217  void PLIB_PORTS_CnPinsPullUpEnable
20218  (
20219  PORTS_MODULE_ID index,
20220  PORTS_CN_PIN cnPins
20221  );
20222  Summary:
20223  Enables Change Notice pull-up for the selected channel pins.
20224  Description:
20225  This function enables the Change Notice pull-up for the selected
20226  channel pins.
20227  This function performs atomic register access.
20228  Precondition:
20229  None.
20230  Parameters:
20231  index - Identifier for the device instance to be configured
20232  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20233  can be ORed.
20234  Returns:
20235  None.
20236  Example:
20237  <code>
20238 
20239  // Enable pull-up for CN5, CN8 and CN13 pins
20240  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20241  CHANGE_NOTICE_PIN_8 |
20242  CHANGE_NOTICE_PIN_13);
20243 
20244  </code>
20245  Remarks:
20246  This function is only available in devices without PPS feature. For PPS
20247  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20248 
20249  This feature may not be available on all devices. Please refer to the
20250  specific device data sheet to determine availability or use
20251  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20252  determine whether this feature is available.
20253 */
20254 
20255 void
20257  PORTS_MODULE_ID index ,
20258  PORTS_CN_PIN cnPins ) ;
20259 // *****************************************************************************
20260 /* Function:
20261  void PLIB_PORTS_CnPinsPullUpDisable
20262  (
20263  PORTS_MODULE_ID index,
20264  PORTS_CN_PIN cnPins
20265  );
20266  Summary:
20267  Disables Change Notice pull-up for the selected channel pins.
20268  Description:
20269  This function Disables the Change Notice pull-up for the selected
20270  channel pins.
20271  This function performs atomic register access.
20272  Precondition:
20273  None.
20274  Parameters:
20275  index - Identifier for the device instance to be configured
20276  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20277  can be ORed.
20278  Returns:
20279  None.
20280  Example:
20281  <code>
20282 
20283  // Disable pull-up for CN5, CN8 and CN13 pins
20284  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20285  CHANGE_NOTICE_PIN_5 |
20286  CHANGE_NOTICE_PIN_8 |
20287  CHANGE_NOTICE_PIN_13);
20288 
20289  </code>
20290  Remarks:
20291  This function is only available in devices without PPS feature. For PPS
20292  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20293 
20294  This feature may not be available on all devices. Please refer to the
20295  specific device data sheet to determine availability or use
20296  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20297  determine whether this feature is available.
20298 */
20299 
20300 void
20302  PORTS_MODULE_ID index ,
20303  PORTS_CN_PIN cnPins ) ;
20304 // *****************************************************************************
20305 /* Function:
20306  void PLIB_PORTS_CnPinsEnable
20307  (
20308  PORTS_MODULE_ID index,
20309  PORTS_CN_PIN cnPins
20310  );
20311  Summary:
20312  Enables CN interrupt for the selected pins of a channel.
20313  Description:
20314  This function enables Change Notice interrupt for the selected port
20315  pins of a channel.
20316  This function performs atomic register access.
20317  Precondition:
20318  None.
20319  Parameters:
20320  index - Identifier for the device instance to be configured
20321  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20322  Returns:
20323  None.
20324  Example:
20325  <code>
20326 
20327  // Enable CN interrupt for CN5, CN8 and CN13 pins
20328  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20329  CHANGE_NOTICE_PIN_5 |
20330  CHANGE_NOTICE_PIN_8 |
20331  CHANGE_NOTICE_PIN_13);
20332 
20333  </code>
20334  Remarks:
20335  This function is only available in devices without PPS feature. For PPS
20336  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20337 
20338  This feature may not be available on all devices. Please refer to the
20339  specific device data sheet to determine availability or use
20340  PLIB_PORTS_ExistsPinChangeNotice in your application to
20341  determine whether this feature is available.
20342 */
20343 
20344 void
20346  PORTS_MODULE_ID index ,
20347  PORTS_CN_PIN cnPins ) ;
20348 // *****************************************************************************
20349 /* Function:
20350  void PLIB_PORTS_CnPinsDisable
20351  (
20352  PORTS_MODULE_ID index,
20353  PORTS_CN_PIN cnPins
20354  );
20355  Summary:
20356  Disables CN interrupt for the selected pins of a channel.
20357  Description:
20358  This function Disables Change Notice interrupt for the selected port
20359  pins of a channel.
20360  This function performs atomic register access.
20361  Precondition:
20362  None.
20363  Parameters:
20364  index - Identifier for the device instance to be configured
20365  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20366  Returns:
20367  None.
20368  Example:
20369  <code>
20370 
20371  // Disable CN interrupt for CN5, CN8 and CN13 pins
20372  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20373  CHANGE_NOTICE_PIN_5 |
20374  CHANGE_NOTICE_PIN_8 |
20375  CHANGE_NOTICE_PIN_13);
20376 
20377  </code>
20378  Remarks:
20379  This function is only available in devices without PPS feature. For PPS
20380  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20381 
20382  This feature may not be available on all devices. Please refer to the
20383  specific device data sheet to determine availability or use
20384  PLIB_PORTS_ExistsPinChangeNotice in your application to
20385  determine whether this feature is available.
20386 */
20387 
20388 void
20390  PORTS_MODULE_ID index ,
20391  PORTS_CN_PIN cnPins ) ;
20392 // *****************************************************************************
20393 /* Function:
20394  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20395  Summary:
20396  Global Change Notice enable.
20397  Description:
20398  This function enables the global Change Notice feature.
20399  This function performs atomic register access.
20400  Precondition:
20401  None.
20402  Parameters:
20403  index - Identifier for the device instance to be configured
20404  Returns:
20405  None.
20406  Example:
20407  <code>
20408 
20409  // Enable Change Notification
20410  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20411 
20412  </code>
20413  Remarks:
20414  This function is only available in devices without PPS. For PPS devices, use the
20415  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20416 
20417  This feature may not be available on all devices. Please refer to the
20418  specific device data sheet to determine availability or use
20419  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20420  this feature is available.
20421 */
20422 
20423 void
20425  PORTS_MODULE_ID index ) ;
20426 // *****************************************************************************
20427 /* Function:
20428  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20429  Summary:
20430  Global Change Notice disable.
20431  Description:
20432  This function disables the global Change Notice feature.
20433  Precondition:
20434  None.
20435  Parameters:
20436  index - Identifier for the device instance to be configured
20437  Returns:
20438  None.
20439  Example:
20440  <code>
20441 
20442  // Disable Change Notification
20443  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20444 
20445  </code>
20446  Remarks:
20447  This function is only available in devices without PPS. For PPS devices, use the
20448  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20449 
20450  This feature may not be available on all devices. Please refer to the
20451  specific device data sheet to determine availability or use
20452  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20453  this feature is available.
20454 */
20455 
20456 void
20458  PORTS_MODULE_ID index ) ;
20459 // *****************************************************************************
20460 /* Function:
20461  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20462  PORTS_CHANGE_NOTICE_PIN pinNum )
20463  Summary:
20464  Port pin Change Notice interrupt enable.
20465  Description:
20466  This function enables the port pin Change Notice feature.
20467  This function performs atomic register access.
20468  Precondition:
20469  None.
20470  Parameters:
20471  index - Identifier for the device instance to be configured
20472  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20473  Returns:
20474  None.
20475  Example:
20476  <code>
20477 
20478  // Enable Change Notice interrupt for pin CN13
20479  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20480 
20481  </code>
20482  Remarks:
20483  This function is only available in devices without PPS. For PPS devices, use the
20484  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20485 
20486  This feature may not be available on all devices. Please refer to the
20487  specific device data sheet to determine availability or use
20488  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20489  this feature is available.
20490 */
20491 
20492 void
20494  PORTS_MODULE_ID index ,
20495  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20496 // *****************************************************************************
20497 /* Function:
20498  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20499  PORTS_CHANGE_NOTICE_PIN pinNum )
20500  Summary:
20501  Port pin Change Notice disable.
20502  Description:
20503  This function disables the port pin Change Notice feature.
20504  This function performs atomic register access.
20505  Precondition:
20506  None.
20507  Parameters:
20508  index - Identifier for the device instance to be configured
20509  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20510  Returns:
20511  None.
20512  Example:
20513  <code>
20514 
20515  // Disable Change Notice interrupt for pin CN13
20516  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20517 
20518  </code>
20519  Remarks:
20520  This function is only available in devices without PPS. For PPS devices, use the
20521  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20522 
20523  This feature may not be available on all devices. Please refer to the
20524  specific device data sheet to determine availability or use
20525  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20526  this feature is available.
20527 */
20528 
20529 void
20531  PORTS_MODULE_ID index ,
20532  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20533 // *****************************************************************************
20534 /* Function:
20535  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20536  Summary:
20537  CPU Idle mode does not affect Change Notice operation.
20538  Description:
20539  This function makes sure that Change Notice feature continues working in
20540  Idle mode.
20541  This function performs atomic register access.
20542 
20543  Precondition:
20544  None.
20545  Parameters:
20546  index - Identifier for the device instance to be configured
20547  Returns:
20548  None.
20549  Example:
20550  <code>
20551 
20552  // Change notification feature will be working even when CPU goes to
20553  // Idle mode
20554  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
20555 
20556  </code>
20557  Remarks:
20558  This function is only available in devices without PPS. For PPS devices, use the
20559  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
20560 
20561  This feature may not be available on all devices. Please refer to the
20562  specific device data sheet to determine availability or use
20563  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20564  this feature is available.
20565 */
20566 
20567 void
20569  PORTS_MODULE_ID index ) ;
20570 // *****************************************************************************
20571 /* Function:
20572  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
20573  Summary:
20574  CPU Idle halts the Change Notice operation.
20575  Description:
20576  This function halts the Change Notice operation when the CPU enters
20577  Idle mode.
20578  This function performs atomic register access.
20579  Precondition:
20580  None.
20581  Parameters:
20582  index - Identifier for the device instance to be configured
20583  Returns:
20584  None.
20585  Example:
20586  <code>
20587  // Halts the Change notification operation when CPU enters Idle mode
20588  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
20589 
20590  </code>
20591  Remarks:
20592  This function is only available in devices without PPS. For PPS devices, use the
20593  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
20594 
20595  This feature may not be available on all devices. Please refer to the
20596  specific device data sheet to determine availability or use
20597  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20598  this feature is available.
20599 */
20600 
20601 void
20603  PORTS_MODULE_ID index ) ;
20604 // *****************************************************************************
20605 /* Function:
20606  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
20607  PORTS_CHANGE_NOTICE_PIN pinNum )
20608  Summary:
20609  Enable pull-up on input change.
20610  Description:
20611  This function enables pull-up on selected input change notification pin.
20612  This function performs atomic register access.
20613  Precondition:
20614  None.
20615  Parameters:
20616  index - Identifier for the device instance to be configured
20617  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20618  Returns:
20619  None.
20620  Example:
20621  <code>
20622 
20623  // Enable pull-up on pin CN13
20624  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
20625 
20626  </code>
20627  Remarks:
20628  This function is only available in devices without PPS. For PPS devices, use the
20629  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
20630 
20631  This feature may not be available on all devices. Please refer to the
20632  specific device data sheet to determine availability or use
20633  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20634  this feature is available.
20635 */
20636 
20637 void
20639  PORTS_MODULE_ID index ,
20640  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20641 // *****************************************************************************
20642 /* Function:
20643  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
20644  PORTS_CHANGE_NOTICE_PIN pinNum )
20645  Summary:
20646  Disable pull-up on input change.
20647  Description:
20648  This function disables pull-up on selected input change notification pin.
20649  This function performs atomic register access.
20650  Precondition:
20651  None.
20652  Parameters:
20653  index - Identifier for the device instance to be configured
20654  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20655  Returns:
20656  None.
20657  Example:
20658  <code>
20659 
20660  // Disable pull-up on pin CN13
20661  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
20662 
20663  </code>
20664  Remarks:
20665  This function is only available in devices without PPS. For PPS devices, use the
20666  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
20667 
20668  This feature may not be available on all devices. Please refer to the
20669  specific device data sheet to determine availability or use
20670  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20671  this feature is available.
20672 */
20673 
20674 void
20676  PORTS_MODULE_ID index ,
20677  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20678 // *****************************************************************************
20679 /* Function:
20680  void PLIB_PORTS_ChannelSlewRateSelect
20681  (
20682  PORTS_MODULE_ID index,
20683  PORTS_CHANNEL channel,
20684  PORTS_DATA_MASK channelMask,
20685  PORTS_PIN_SLEW_RATE slewRate
20686  );
20687  Summary:
20688  Selects the slew rate for selected channel pins.
20689  Description:
20690  This function selects the slew rate for selected channel pins.
20691  This function does not perform atomic register access.
20692  Precondition:
20693  None.
20694  Parameters:
20695  index - Identifier for the device instance to be configured
20696  channel - Port pin channel
20697  channelMask - Identifies the pins for which slew rate has to be modified.
20698  Slew rate of the pins which corresponding bit is "1" get
20699  modified, slew rate of the other pins remains the same.
20700  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
20701  Returns:
20702  None.
20703  Example:
20704  <code>
20705 
20706  // Make slew rate of pins RC5, RC8 and RC13 slowest
20707  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
20708  PORT_CHANNEL_C,
20709  0x2120,
20710  PORTS_PIN_SLEW_RATE_SLOWEST);
20711 
20712  </code>
20713  Remarks:
20714  This feature may not be available on all devices. Please refer to the
20715  specific device data sheet to determine availability or use
20716  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20717  whether this feature is available.
20718 */
20719 
20720 void
20722  PORTS_MODULE_ID index ,
20723  PORTS_CHANNEL channel ,
20724  PORTS_DATA_MASK channelMask ,
20725  PORTS_PIN_SLEW_RATE slewRate ) ;
20726 // *****************************************************************************
20727 /* Function:
20728 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
20729  (
20730  PORTS_MODULE_ID index,
20731  PORTS_CHANNEL channel,
20732  PORTS_BIT_POS bitPos
20733  );
20734  Summary:
20735  Gets the slew rate for selected port pin.
20736  Description:
20737  This function gets the slew rate of selected port pin.
20738  This function does not perform atomic register access.
20739  Precondition:
20740  None.
20741  Parameters:
20742  index - Identifier for the device instance to be configured
20743  channel - Port pin channel
20744  bitPos - One of the possible values of PORTS_BIT_POS.
20745  Returns:
20746  One of the possible values of PORTS_PIN_SLEW_RATE.
20747  Example:
20748  <code>
20749  PORTS_PIN_SLEW_RATE slewRate;
20750 
20751  // Get the slew rate of pin RC1
20752  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
20753 
20754  </code>
20755  Remarks:
20756  This feature may not be available on all devices. Please refer to the
20757  specific device data sheet to determine availability or use
20758  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20759  whether this feature is available.
20760 */
20761 
20762 PORTS_PIN_SLEW_RATE
20764  PORTS_MODULE_ID index ,
20765  PORTS_CHANNEL channel ,
20766  PORTS_BIT_POS bitPos ) ;
20767 // *****************************************************************************
20768 /* Function:
20769  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
20770  (
20771  PORTS_MODULE_ID index,
20772  PORTS_CHANNEL channel,
20773  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
20774  );
20775  Summary:
20776  Selects the Change Notice style for selected port channel.
20777  Description:
20778  This function selects the Change Notice style (or method) for selected port
20779  channel. It allows user to select whether the Change Notice detection will
20780  happen based on edge transition or level transition on all the CN pins of a
20781  particular channel.
20782  This function does not perform atomic register access.
20783  Precondition:
20784  None.
20785  Parameters:
20786  index - Identifier for the device instance to be configured
20787  channel - Port pin channel
20788  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20789  Returns:
20790  None.
20791  Example:
20792  <code>
20793  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
20794  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
20795  </code>
20796  Remarks:
20797  This feature may not be available on all devices. Please refer to the
20798  specific device data sheet to determine availability or use
20799  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20800  whether this feature is available.
20801 */
20802 
20803 void
20805  PORTS_MODULE_ID index ,
20806  PORTS_CHANNEL channel ,
20807  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
20808 // *****************************************************************************
20809 /* Function:
20810  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
20811  (
20812  PORTS_MODULE_ID index,
20813  PORTS_CHANNEL channel
20814  );
20815  Summary:
20816  Gets the Change Notice style for the selected port channel.
20817  Description:
20818  This function gets the Change Notice style (or method) for the selected port
20819  channel.
20820  This function does not perform atomic register access.
20821  Precondition:
20822  None.
20823  Parameters:
20824  index - Identifier for the device instance to be configured
20825  channel - Port pin channel
20826  Returns:
20827  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20828  Example:
20829  <code>
20830  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
20831  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
20832  </code>
20833  Remarks:
20834  This feature may not be available on all devices. Please refer to the
20835  specific device data sheet to determine availability or use
20836  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20837  whether this feature is available.
20838 */
20839 
20840 PORTS_CHANGE_NOTICE_METHOD
20842  PORTS_MODULE_ID index ,
20843  PORTS_CHANNEL channel ) ;
20844 // *****************************************************************************
20845 /* Function:
20846  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
20847  (
20848  PORTS_MODULE_ID index,
20849  PORTS_CHANNEL channel,
20850  PORTS_DATA_MASK edgeRisingMask,
20851  PORTS_DATA_MASK edgeFallingMask
20852  );
20853  Summary:
20854  Enables selected type of edge for selected CN pins.
20855  Description:
20856  This function Enables selected type of edge (falling or rising) for
20857  selected CN pins of a port channel.
20858  This function does not perform atomic register access.
20859  Precondition:
20860  Change Notice method should be selected as
20861  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20862  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20863  Parameters:
20864  index - Identifier for the device instance to be configured
20865  channel - Port pin channel
20866  edgeRisingMask - Identifies the pins for which Change Notice has to be
20867  enabled for rising edge. Change Notice interrupt at rising
20868  edge is enabled for the pins which corresponding bit is
20869  '1', for the other pins it remains the same.
20870  edgeFallingMask - Identifies the pins for which Change Notice has to be
20871  enabled for falling edge. Change Notice interrupt at
20872  falling edge is enabled for the pins which corresponding
20873  bit is '1', for the other pins it remains the same.
20874  Returns:
20875  None.
20876  Example:
20877  <code>
20878  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
20879  // RC1 & RC5 pins.
20880  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20881  </code>
20882  Remarks:
20883  This feature is not available on all devices. Please refer to the
20884  specific device data sheet to determine availability or use
20885  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20886  whether this feature is available.
20887 */
20888 
20889 void
20891  PORTS_MODULE_ID index ,
20892  PORTS_CHANNEL channel ,
20893  PORTS_DATA_MASK edgeRisingMask ,
20894  PORTS_DATA_MASK edgeFallingMask ) ;
20895 // *****************************************************************************
20896 /* Function:
20897  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
20898  (
20899  PORTS_MODULE_ID index,
20900  PORTS_CHANNEL channel,
20901  PORTS_DATA_MASK edgeRisingMask,
20902  PORTS_DATA_MASK edgeFallingMask
20903  );
20904  Summary:
20905  Disables selected type of edge for selected CN pins.
20906  Description:
20907  This function Disables selected type of edge (falling or rising) for
20908  selected CN pins of a port channel.
20909  This function does not perform atomic register access.
20910  Precondition:
20911  Change Notice method should be selected as
20912  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20913  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20914  Parameters:
20915  index - Identifier for the device instance to be configured
20916  channel - Port pin channel
20917  edgeRisingMask - Identifies the pins for which Change Notice has to be
20918  enabled for rising edge. Change notice interrupt at rising
20919  edge is enabled for the pins which corresponding bit is
20920  '1', for the other pins it remains the same.
20921  edgeFallingMask - Identifies the pins for which Change Notice has to be
20922  enabled for falling edge. Change notice interrupt at
20923  falling edge is enabled for the pins which corresponding
20924  bit is '1', for the other pins it remains the same.
20925  Returns:
20926  None.
20927  Example:
20928  <code>
20929  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
20930  // RC1 & RC5 pins.
20931  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20932  </code>
20933  Remarks:
20934  This feature is not available on all devices. Please refer to the
20935  specific device data sheet to determine availability or use
20936  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20937  whether this feature is available.
20938 */
20939 
20940 void
20942  PORTS_MODULE_ID index ,
20943  PORTS_CHANNEL channel ,
20944  PORTS_DATA_MASK edgeRisingMask ,
20945  PORTS_DATA_MASK edgeFallingMask ) ;
20946 // *****************************************************************************
20947 /* Function:
20948  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
20949  (
20950  PORTS_MODULE_ID index,
20951  PORTS_CHANNEL channel,
20952  PORTS_BIT_POS bitPos,
20953  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
20954  );
20955  Summary:
20956  Check if Change Notice edge is enabled or not.
20957  This function does not perform atomic register access.
20958  Description:
20959  This function checks if selected type of Change Notice edge is enabled on a
20960  particular port pin or not.
20961  This function does not perform atomic register access.
20962  Precondition:
20963  None.
20964  Parameters:
20965  index - Identifier for the device instance to be configured
20966  channel - Port pin channel
20967  bitPos - One of the possible values of PORTS_BIT_POS.
20968  cnEdgeType - Type of the edge which has to be checked.
20969 
20970  Returns:
20971  - true - Selected type of Change Notice Edge is enabled.
20972  - false - Selected type of Change Notice Edge is not enabled.
20973 
20974  Example:
20975  <code>
20976  // Check if Change Notice at rising edge is enabled or not for pin RC1.
20977  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
20978  {
20979  // do something
20980  }
20981  </code>
20982  Remarks:
20983  This feature is not available on all devices. Please refer to the
20984  specific device data sheet to determine availability or use
20985  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20986  whether this feature is available.
20987 */
20988 
20989 bool
20991  PORTS_MODULE_ID index ,
20992  PORTS_CHANNEL channel ,
20993  PORTS_BIT_POS bitPos ,
20994  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
20995 // *****************************************************************************
20996 /* Function:
20997  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
20998  (
20999  PORTS_MODULE_ID index,
21000  PORTS_CHANNEL channel,
21001  PORTS_BIT_POS bitPos
21002  );
21003  Summary:
21004  Check Change Notice edge status.
21005  Description:
21006  This function checks whether or no a Change Notice edge transition has occurred
21007  on the selected port pin.
21008  This function does not perform atomic register access.
21009  Precondition:
21010  None.
21011  Parameters:
21012  index - Identifier for the device instance to be configured
21013  channel - Port pin channel
21014  bitPos - One of the possible values of PORTS_BIT_POS
21015 
21016  Returns:
21017  - true - Change Notice edge transition has occurred
21018  - false - Change Notice edge transition has not occurred
21019 
21020  Example:
21021  <code>
21022  // Check if Change Notice edge transition has occurred for pin RC1.
21023  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21024  {
21025  // do something
21026  }
21027  </code>
21028  Remarks:
21029  This feature is not available on all devices. Please refer to the
21030  specific device data sheet to determine availability or use
21031  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21032  whether this feature is available.
21033 */
21034 
21035 bool
21037  PORTS_MODULE_ID index ,
21038  PORTS_CHANNEL channel ,
21039  PORTS_BIT_POS bitPos ) ;
21040 // *****************************************************************************
21041 // *****************************************************************************
21042 // Section: Ports Peripheral Library Exists Functions
21043 // *****************************************************************************
21044 // *****************************************************************************
21045 /* The functions below indicate the existence of the features on the device.
21046 */
21047 //******************************************************************************
21048 /* Function:
21049  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21050  Summary:
21051  Identifies whether the RemapInput feature exists on the Ports module.
21052  Description:
21053  This function identifies whether the RemapInput feature is available on the
21054  Ports module.
21055  When this function returns true, this function is supported on the device:
21056  - PLIB_PORTS_RemapInput
21057  Preconditions:
21058  None.
21059  Parameters:
21060  index - Identifier for the device instance
21061  Returns:
21062  - true - The RemapInput feature is supported on the device
21063  - false - The RemapInput feature is not supported on the device
21064  Remarks:
21065  None.
21066 */
21067 
21068 bool
21070  PORTS_MODULE_ID index ) ;
21071 //******************************************************************************
21072 /* Function:
21073  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21074  Summary:
21075  Identifies whether the RemapOutput feature exists on the Ports module.
21076  Description:
21077  This function identifies whether the RemapOutput feature is available on the
21078  Ports module.
21079  When this function returns true, this function is supported on the device:
21080  - PLIB_PORTS_RemapOutput
21081  Preconditions:
21082  None.
21083  Parameters:
21084  index - Identifier for the device instance
21085  Returns:
21086  - true - The RemapOutput feature is supported on the device
21087  - false - The RemapOutput feature is not supported on the device
21088  Remarks:
21089  None.
21090 */
21091 
21092 bool
21094  PORTS_MODULE_ID index ) ;
21095 //******************************************************************************
21096 /* Function:
21097  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21098  Summary:
21099  Identifies whether the PinMode feature exists on the Ports module.
21100  Description:
21101  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21102  feature is available on the Ports module.
21103  When this function returns true, this function is supported on the device:
21104  - PLIB_PORTS_PinModeSelect
21105  Preconditions:
21106  None.
21107  Parameters:
21108  index - Identifier for the device instance
21109  Returns:
21110  - true - The PinMode feature is supported on the device
21111  - false - The PinMode feature is not supported on the device
21112  Remarks:
21113  None.
21114 */
21115 
21116 bool
21118  PORTS_MODULE_ID index ) ;
21119 //******************************************************************************
21120 /* Function:
21121  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21122  Summary:
21123  Identifies whether the AnPinsMode feature exists on the Ports module.
21124  Description:
21125  This function identifies whether the AnPinsMode feature is available on the
21126  Ports module.
21127  When this function returns true, this function is supported on the device:
21128  - PLIB_PORTS_AnPinsModeSelect
21129  Preconditions:
21130  None.
21131  Parameters:
21132  index - Identifier for the device instance
21133  Returns:
21134  - true - The AnPinsMode feature is supported on the device
21135  - false - The AnPinsMode feature is not supported on the device
21136  Remarks:
21137  None.
21138 */
21139 
21140 bool
21142  PORTS_MODULE_ID index ) ;
21143 //******************************************************************************
21144 /* Function:
21145  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21146  Summary:
21147  Identifies whether the PortsRead feature exists on the Ports module.
21148  Description:
21149  This function identifies whether the PortsRead feature is available on the
21150  Ports module.
21151  When this function returns true, these functions are supported on the device:
21152  - PLIB_PORTS_PinGet
21153  - PLIB_PORTS_Read
21154  Preconditions:
21155  None.
21156  Parameters:
21157  index - Identifier for the device instance
21158  Returns:
21159  - true - The PortsRead feature is supported on the device
21160  - false - The PortsRead feature is not supported on the device
21161  Remarks:
21162  None.
21163 */
21164 
21165 bool
21167  PORTS_MODULE_ID index ) ;
21168 //******************************************************************************
21169 /* Function:
21170  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21171  Summary:
21172  Identifies whether the LatchRead feature exists on the Ports module.
21173  Description:
21174  This function identifies whether the LatchRead feature is available on the
21175  Ports module.
21176  When this function returns true, these functions are supported on the device:
21177  - PLIB_PORTS_PinGetLatched
21178  - PLIB_PORTS_ReadLatched
21179  Preconditions:
21180  None.
21181  Parameters:
21182  index - Identifier for the device instance
21183  Returns:
21184  - true - The LatchRead feature is supported on the device
21185  - false - The LatchRead feature is not supported on the device
21186  Remarks:
21187  None.
21188 */
21189 
21190 bool
21192  PORTS_MODULE_ID index ) ;
21193 //******************************************************************************
21194 /* Function:
21195  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21196  Summary:
21197  Identifies whether the PortsWrite feature exists on the Ports module.
21198  Description:
21199  This function identifies whether the PortsWrite feature is available on the
21200  Ports module.
21201  When this function returns true, these functions are supported on the device:
21202  - PLIB_PORTS_PinWrite
21203  - PLIB_PORTS_PinSet
21204  - PLIB_PORTS_PinClear
21205  - PLIB_PORTS_PinToggle
21206  - PLIB_PORTS_Write
21207  - PLIB_PORTS_Set
21208  - PLIB_PORTS_Toggle
21209  - PLIB_PORTS_Clear
21210  Preconditions:
21211  None.
21212  Parameters:
21213  index - Identifier for the device instance
21214  Returns:
21215  - true - The PortsWrite feature is supported on the device
21216  - false - The PortsWrite feature is not supported on the device
21217  Remarks:
21218  None.
21219 */
21220 
21221 bool
21223  PORTS_MODULE_ID index ) ;
21224 //******************************************************************************
21225 /* Function:
21226  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21227  Summary:
21228  Identifies whether the PortsDirection feature exists on the Ports module.
21229  Description:
21230  This function identifies whether the PortsDirection feature is available on the
21231  Ports module.
21232  When this function returns true, these functions are supported on the device:
21233  - PLIB_PORTS_PinDirectionInputSet
21234  - PLIB_PORTS_PinDirectionOutputSet
21235  - PLIB_PORTS_DirectionInputSet
21236  - PLIB_PORTS_DirectionOutputSet
21237  - PLIB_PORTS_DirectionGet
21238  Preconditions:
21239  None.
21240  Parameters:
21241  index - Identifier for the device instance
21242  Returns:
21243  - true - The PortsDirection feature is supported on the device
21244  - false - The PortsDirection feature is not supported on the device
21245  Remarks:
21246  None.
21247 */
21248 
21249 bool
21251  PORTS_MODULE_ID index ) ;
21252 //******************************************************************************
21253 /* Function:
21254  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21255  Summary:
21256  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21257  Description:
21258  This function identifies whether the PortsOpenDrain feature is available on
21259  the Ports module.
21260  When this function returns true, these functions are supported on the device:
21261  - PLIB_PORTS_PinOpenDrainEnable
21262  - PLIB_PORTS_PinOpenDrainDisable
21263  - PLIB_PORTS_OpenDrainEnable
21264  - PLIB_PORTS_OpenDrainDisable
21265  Preconditions:
21266  None.
21267  Parameters:
21268  index - Identifier for the device instance
21269  Returns:
21270  - true - The PortsOpenDrain feature is supported on the device
21271  - false - The PortsOpenDrain feature is not supported on the device
21272  Remarks:
21273  None.
21274 */
21275 
21276 bool
21278  PORTS_MODULE_ID index ) ;
21279 //******************************************************************************
21280 /* Function:
21281  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21282  Summary:
21283  Identifies whether the ChangeNotice feature exists on the Ports module.
21284  Description:
21285  This function identifies whether the ChangeNotice feature is available on the
21286  Ports module.
21287  When this function returns true, these functions are supported on the device:
21288  - PLIB_PORTS_ChangeNoticeEnable
21289  - PLIB_PORTS_ChangeNoticeDisable
21290  Preconditions:
21291  None.
21292  Parameters:
21293  index - Identifier for the device instance
21294  Returns:
21295  - true - The ChangeNotice feature is supported on the device
21296  - false - The ChangeNotice feature is not supported on the device
21297  Remarks:
21298  None.
21299 */
21300 
21301 bool
21303  PORTS_MODULE_ID index ) ;
21304 //******************************************************************************
21305 /* Function:
21306  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21307  Summary:
21308  Identifies whether the PinChangeNotice feature exists on the Ports module.
21309  Description:
21310  This function identifies whether the PinChangeNotice feature is available on
21311  the Ports module.
21312  When this function returns true, these functions are supported on the device:
21313  - PLIB_PORTS_PinChangeNoticeEnable
21314  - PLIB_PORTS_PinChangeNoticeDisable
21315  - PLIB_PORTS_CnPinsEnable
21316  - PLIB_PORTS_CnPinsDisable
21317  Preconditions:
21318  None.
21319  Parameters:
21320  index - Identifier for the device instance
21321  Returns:
21322  - true - The PinChangeNotice feature is supported on the device
21323  - false - The PinChangeNotice feature is not supported on the device
21324  Remarks:
21325  None.
21326 */
21327 
21328 bool
21330  PORTS_MODULE_ID index ) ;
21331 //******************************************************************************
21332 /* Function:
21333  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21334  Summary:
21335  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21336  Description:
21337  This function identifies whether the ChangeNoticeInIdle feature is available
21338  on the Ports module.
21339  When this function returns true, these functions are supported on the device:
21340  - PLIB_PORTS_ChangeNoticeInIdleEnable
21341  - PLIB_PORTS_ChangeNoticeInIdleDisable
21342  Preconditions:
21343  None.
21344  Parameters:
21345  index - Identifier for the device instance
21346  Returns:
21347  - true - The ChangeNoticeInIdle feature is supported on the device
21348  - false - The ChangeNoticeInIdle feature is not supported on the device
21349  Remarks:
21350  None.
21351 */
21352 
21353 bool
21355  PORTS_MODULE_ID index ) ;
21356 //******************************************************************************
21357 /* Function:
21358  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21359  Summary:
21360  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21361  Description:
21362  This function identifies whether the ChangeNoticePullup feature is available
21363  on the Ports module.
21364  When this function returns true, these functions are supported on the device:
21365  - PLIB_PORTS_ChangeNoticePullUpEnable
21366  - PLIB_PORTS_ChangeNoticePullUpDisable
21367  - PLIB_PORTS_CnPinsPullUpEnable
21368  - PLIB_PORTS_CnPinsPullUpDisable
21369  Preconditions:
21370  None.
21371  Parameters:
21372  index - Identifier for the device instance
21373  Returns:
21374  - true - The ChangeNoticePullup feature is supported on the device
21375  - false - The ChangeNoticePullup feature is not supported on the device
21376  Remarks:
21377  None.
21378 */
21379 
21380 bool
21382  PORTS_MODULE_ID index ) ;
21383 //******************************************************************************
21384 /* Function:
21385  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21386  Summary:
21387  Identifies whether the PinModePerPort feature exists on the Ports module.
21388  Description:
21389  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21390  feature is available on the Ports module.
21391  When this function returns true, these functions are supported on the device:
21392  - PLIB_PORTS_PinModePerPortSelect
21393  - PLIB_PORTS_ChannelModeSelect
21394  Preconditions:
21395  None.
21396  Parameters:
21397  index - Identifier for the device instance
21398  Returns:
21399  - true - The PinModePerPort feature is supported on the device
21400  - false - The PinModePerPort feature is not supported on the device
21401  Remarks:
21402  None.
21403 */
21404 
21405 bool
21407  PORTS_MODULE_ID index ) ;
21408 //******************************************************************************
21409 /* Function:
21410  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21411  Summary:
21412  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21413  Ports module.
21414  Description:
21415  This function identifies whether the ChangeNoticePullDownPerPort feature is
21416  available on the Ports module.
21417  When this function returns true, these functions are supported on the device:
21418  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21419  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21420  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21421  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21422  Preconditions:
21423  None.
21424  Parameters:
21425  index - Identifier for the device instance
21426  Returns:
21427  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21428  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21429  Remarks:
21430  None.
21431 */
21432 
21433 bool
21435  PORTS_MODULE_ID index ) ;
21436 //******************************************************************************
21437 /* Function:
21438  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21439  Summary:
21440  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21441  module.
21442  Description:
21443  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21444  on the Ports module.
21445  When this function returns true, these functions are supported on the device:
21446  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21447  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21448  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21449  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21450  Preconditions:
21451  None.
21452  Parameters:
21453  index - Identifier for the device instance
21454  Returns:
21455  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21456  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21457  Remarks:
21458  None.
21459 */
21460 
21461 bool
21463  PORTS_MODULE_ID index ) ;
21464 //******************************************************************************
21465 /* Function:
21466  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21467  Summary:
21468  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21469  module.
21470  Description:
21471  This function identifies whether the PinChangeNoticePerPort feature is
21472  available on the Ports module.
21473  When this function returns true, these functions are supported on the device:
21474  - PLIB_PORTS_PinChangeNoticePerPortEnable
21475  - PLIB_PORTS_PinChangeNoticePerPortDisable
21476  - PLIB_PORTS_ChannelChangeNoticeEnable
21477  - PLIB_PORTS_ChannelChangeNoticeDisable
21478  Preconditions:
21479  None.
21480  Parameters:
21481  index - Identifier for the device instance
21482  Returns:
21483  - true - The PinChangeNoticePerPort feature is supported on the device
21484  - false - The PinChangeNoticePerPort feature is not supported on the device
21485  Remarks:
21486  None.
21487 */
21488 
21489 bool
21491  PORTS_MODULE_ID index ) ;
21492 //******************************************************************************
21493 /* Function:
21494  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21495  Summary:
21496  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21497  module.
21498  Description:
21499  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21500  available on the Ports module.
21501  When this function returns true, these functions are supported on the device:
21502  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21503  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21504  Preconditions:
21505  None.
21506  Parameters:
21507  index - Identifier for the device instance
21508  Returns:
21509  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21510  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21511  Remarks:
21512  None.
21513 */
21514 
21515 bool
21517  PORTS_MODULE_ID index ) ;
21518 //******************************************************************************
21519 /* Function:
21520  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21521  Summary:
21522  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21523  module.
21524  Description:
21525  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21526  available on the Ports module.
21527  When this function returns true, these functions are supported on the device:
21528  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21529  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21530  Preconditions:
21531  None.
21532  Parameters:
21533  index - Identifier for the device instance
21534  Returns:
21535  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21536  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21537  Remarks:
21538  None.
21539 */
21540 
21541 bool
21543  PORTS_MODULE_ID index ) ;
21544 //******************************************************************************
21545 /* Function:
21546  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
21547  Summary:
21548  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
21549  module.
21550  Description:
21551  This function identifies whether the ChangeNoticePerPortStatus feature is
21552  available on the Ports module.
21553  When this function returns true, these functions are supported on the device:
21554  - PLIB_PORTS_ChangeNoticePerPortHasOccured
21555  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
21556  Preconditions:
21557  None.
21558  Parameters:
21559  index - Identifier for the device instance
21560  Returns:
21561  - true - The ChangeNoticePerPortStatus feature is supported on the device
21562  - false - The ChangeNoticePerPortStatus feature is not supported on the device
21563  Remarks:
21564  None.
21565 */
21566 
21567 bool
21569  PORTS_MODULE_ID index ) ;
21570 //******************************************************************************
21571 /* Function:
21572  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
21573  Summary:
21574  Identifies whether the SlewRateControl feature exists on the Ports module.
21575  Description:
21576  This function identifies whether the SlewRateControl feature is available
21577  on the Ports module.
21578  When this function returns true, these functions are supported on the device:
21579  - PLIB_PORTS_ChannelSlewRateSelect
21580  - PLIB_PORTS_PinSlewRateGet
21581  Preconditions:
21582  None.
21583  Parameters:
21584  index - Identifier for the device instance
21585  Returns:
21586  - true - The SlewRateControl feature is supported on the device
21587  - false - The SlewRateControl feature is not supported on the device
21588  Remarks:
21589  None.
21590 */
21591 
21592 bool
21594  PORTS_MODULE_ID index ) ;
21595 //******************************************************************************
21596 /* Function:
21597  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
21598  Summary:
21599  Identifies whether the ChannelChangeNoticeMethod feature exists on the
21600  Ports module.
21601  Description:
21602  This function identifies whether the ChannelChangeNoticeMethod feature is
21603  available on the Ports module.
21604  When this function returns true, these functions are supported on the device:
21605  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
21606  - PLIB_PORTS_ChannelChangeNoticeMethodGet
21607  Preconditions:
21608  None.
21609  Parameters:
21610  index - Identifier for the device instance
21611  Returns:
21612  - true - The ChannelChangeNoticeMethod feature is supported on the device
21613  - false - The ChannelChangeNoticeMethod feature is not supported on the device
21614  Remarks:
21615  None.
21616 */
21617 
21618 bool
21620  PORTS_MODULE_ID index ) ;
21621 //******************************************************************************
21622 /* Function:
21623  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
21624  Summary:
21625  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
21626  module.
21627  Description:
21628  This function identifies whether the ChangeNoticeEdgeControl feature is
21629  available on the Ports module.
21630  When this function returns true, these functions are supported on the device:
21631  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21632  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21633  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21634  Preconditions:
21635  None.
21636  Parameters:
21637  index - Identifier for the device instance
21638  Returns:
21639  - true - The ChangeNoticeEdgeControl feature is supported on the device
21640  - false - The ChangeNoticeEdgeControl feature is not supported on the device
21641  Remarks:
21642  None.
21643 */
21644 
21645 bool
21647  PORTS_MODULE_ID index ) ;
21648 //******************************************************************************
21649 /* Function:
21650  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
21651  Summary:
21652  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
21653  module.
21654  Description:
21655  This function identifies whether the ChangeNoticeEdgeStatus feature is available
21656  on the Ports module.
21657  When this function returns true, this function is supported on the device:
21658  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21659  Preconditions:
21660  None.
21661  Parameters:
21662  index - Identifier for the device instance
21663  Returns:
21664  - true - The ChangeNoticeEdgeStatus feature is supported on the device
21665  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
21666  Remarks:
21667  None.
21668 */
21669 
21670 bool
21672  PORTS_MODULE_ID index ) ;
21673 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
21674 /*******************************************************************************
21675  Ports Peripheral Library Compatibility Header
21676  Company:
21677  Microchip Technology Inc.
21678  File Name:
21679  plib_ports_compatibility.h
21680  Summary:
21681  Ports Peripheral Library Interface header for backward compatibility.
21682  Description:
21683  This header file contains the definitions of the functions which are
21684  supported for backward compatibility only. These will be deprecated later.
21685 *******************************************************************************/
21686 // DOM-IGNORE-BEGIN
21687 /*******************************************************************************
21688 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
21689 Microchip licenses to you the right to use, modify, copy and distribute
21690 Software only when embedded on a Microchip microcontroller or digital signal
21691 controller that is integrated into your product or third party product
21692 (pursuant to the sublicense terms in the accompanying license agreement).
21693 You should refer to the license agreement accompanying this Software for
21694 additional information regarding your rights and obligations.
21695 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
21696 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
21697 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
21698 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
21699 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
21700 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
21701 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
21702 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
21703 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
21704 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
21705 *******************************************************************************/
21706 // DOM-IGNORE-END
21707 #ifndef _PLIB_PORTS_COMPATIBILITY_H
21708 #define _PLIB_PORTS_COMPATIBILITY_H
21709 #include <stdint.h>
21710 #include <stddef.h>
21711 // *****************************************************************************
21712 /* Function:
21713  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
21714  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
21715  Summary:
21716  checks the status of change on the pin
21717  Description:
21718  This function checks if the change has occurred on the given pin or not.
21719  Precondition:
21720  None.
21721  Parameters:
21722  index - Identifier for the device instance to be configured
21723  channel - Port pin channel
21724  bitPos - Position in the PORT pins
21725  Returns:
21726  None.
21727  Example:
21728  <code>
21729 
21730  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
21731  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
21732  {
21733  //do something
21734  }
21735 
21736  </code>
21737  Remarks:
21738  This feature may not be available on all devices. Please refer to the
21739  specific device data sheet to determine availability or use
21740  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
21741  whether this feature is available.
21742 
21743  This function will be deprecated later.
21744 */
21745 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
21746  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
21747 /*******************************************************************************
21748  End of File
21749 */
21750 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
21751 /* CLOSE_FILE Include File */
21752 
21753 //DOM-IGNORE-BEGIN
21754 //DOM-IGNORE-END
21755  // #ifndef _PLIB_PORTS_H
21756 /*******************************************************************************
21757  End of File
21758 */
21759 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
21760 /* CLOSE_FILE Include File */
21761 
21762 #include "system/int/sys_int.h"
21763 // *****************************************************************************
21764 // *****************************************************************************
21765 // Section: SYS PORTS Data Types
21766 // *****************************************************************************
21767 // *****************************************************************************
21768 // *****************************************************************************
21769 /* SYS PORTS PULLUP status
21770  Summary:
21771  Provides the pull-up and pull-down status.
21772  Description:
21773  These constants provide the pull-up or pull-down status definitions.
21774  Remarks:
21775  None.
21776 */
21777 
21778 typedef
21779  enum
21780  {
21781  /* PULLUP Disable */
21783  /*DOM-IGNORE-BEGIN*/
21784  = 0 /*DOM-IGNORE-END*/
21785  ,
21786  /* PULLUP Enable */
21788  /*DOM-IGNORE-BEGIN*/
21789  = 1 /*DOM-IGNORE-END*/
21790  ,
21792 // *****************************************************************************
21793 /* SYS PORTS PIN DIRECTION
21794  Summary:
21795  Defines the direction of the port pins.
21796  Description:
21797  These constants provide the port pin direction definitions.
21798  Remarks:
21799  None.
21800 */
21801 
21802 typedef
21803  enum
21804  {
21805  /* Direction as output */
21807  /*DOM-IGNORE-BEGIN*/
21808  = 0 /*DOM-IGNORE-END*/
21809  ,
21810  /* Direction as input */
21812  /*DOM-IGNORE-BEGIN*/
21813  = 1 /*DOM-IGNORE-END*/
21814  ,
21816 
21817 typedef
21818  enum
21819  {
21822  // #ifndef _SYS_PORTS_DEFINITIONS_H
21823 /*******************************************************************************
21824  End of File
21825 */
21826 
21827 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
21828 /* CLOSE_FILE Include File */
21829 
21830 // DOM-IGNORE-BEGIN
21831 // DOM-IGNORE-END
21832 // *****************************************************************************
21833 // *****************************************************************************
21834 // Section: SYS PorTS Module Initialization Routine
21835 // *****************************************************************************
21836 // *****************************************************************************
21837 // *****************************************************************************
21838 /* Function:
21839  void SYS_PORTS_Initialize()
21840  Summary:
21841  Initializes PORT Pins/Channels.
21842  <p><b>Implementation:</b> Static/Dynamic</p>
21843  Description:
21844  This function initializes different port pins/channels to the desired state.
21845  It also remaps the pins to the desired specific function.
21846  Precondition:
21847  None.
21848  Parameters:
21849  None.
21850  Returns:
21851  None.
21852  Example:
21853  <code>
21854  SYS_PORTS_Initialize();
21855  </code>
21856  Remarks:
21857  This API must be be called at the time of system initialization to
21858  initialize the ports pins.
21859 */
21860 
21861 void
21863 // *****************************************************************************
21864 // *****************************************************************************
21865 // Section: SYS PORTS CONTROL Routines
21866 // *****************************************************************************
21867 // *****************************************************************************
21868 // *****************************************************************************
21869 /* Function:
21870  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21871  Summary:
21872  Reads the data from the I/O port.
21873  <p><b>Implementation:</b> Dynamic</p>
21874  Description:
21875  This function reads the data from the I/O port.
21876  Preconditions:
21877  The direction of the port to be set as input.
21878  Parameters:
21879  index - Identifier for the device instance to be configured
21880  channel - Identifier for the PORT channel: A, B, C, etc.
21881  Returns:
21882  Returns the data read from the port.
21883  Example:
21884  <code>
21885  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21886  // application developer.
21887  PORTS_DATA_TYPE readData;
21888  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
21889  </code>
21890  Remarks:
21891  None.
21892 */
21893 
21895  SYS_PORTS_Read (
21896  PORTS_MODULE_ID index ,
21897  PORTS_CHANNEL channel ) ;
21898 // *****************************************************************************
21899 /* Function:
21900  void SYS_PORTS_Write( PORTS_MODULE_ID index,
21901  PORTS_CHANNEL channel,
21902  PORTS_DATA_TYPE value )
21903  Summary:
21904  Writes the data to the I/O port.
21905  <p><b>Implementation:</b> Dynamic</p>
21906  Description:
21907  This function writes the data to the I/O port.
21908  Preconditions:
21909  The direction of the port to be set as output.
21910  Parameters:
21911  index - Identifier for the device instance to be configured
21912  channel - Identifier for the PORT channel: A, B, C, etc.
21913  value - Value to be written into a port of width PORTS_DATA_TYPE
21914  Returns:
21915  None.
21916  Example:
21917  <code>
21918  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21919  // application developer.
21920  PORTS_DATA_TYPE writeData;
21921  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
21922  </code>
21923  Remarks:
21924  None.
21925 */
21926 
21927 void
21928  SYS_PORTS_Write (
21929  PORTS_MODULE_ID index ,
21930  PORTS_CHANNEL channel ,
21931  PORTS_DATA_TYPE value ) ;
21932 // *****************************************************************************
21933 /* Function:
21934  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21935  Summary:
21936  Reads the data driven on the I/O port.
21937  <p><b>Implementation:</b> Dynamic</p>
21938  Description:
21939  This function reads the data driven on the I/O port.
21940  Preconditions:
21941  The direction of the port to be set as output.
21942  Parameters:
21943  index - Identifier for the device instance to be configured
21944  channel - Identifier for the PORT channel: A, B, C, etc.
21945  Returns:
21946  Returns the data driven on the port.
21947  Example:
21948  <code>
21949  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21950  // application developer.
21951  PORTS_DATA_TYPE drivenData;
21952  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
21953  </code>
21954  Remarks:
21955  None.
21956 */
21957 
21960  PORTS_MODULE_ID index ,
21961  PORTS_CHANNEL channel ) ;
21962 // *****************************************************************************
21963 /* Function:
21964  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
21965  PORTS_DATA_TYPE value,
21966  PORTS_DATA_MASK mask )
21967  Summary:
21968  Sets the selected digital port/latch based on the mask.
21969  <p><b>Implementation:</b> Dynamic</p>
21970  Description:
21971  This function Sets the selected digital port/latch relative to the mask.
21972  This function "AND" value and mask parameters and then set the bits
21973  in the port channel that were set in the result of the ANDing operation.
21974  Preconditions:
21975  None.
21976  Parameters:
21977  index - Identifier for the device instance to be configured
21978  channel - Identifier for the PORT channel: A, B, C, etc.
21979  value - Consists of information about which port bit has to be set
21980  mask - Identifies the bits which could be intended for setting
21981  Returns:
21982  None.
21983  Example:
21984  <code>
21985  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21986  // application developer.
21987  // MY_VALUE - 0x1234
21988  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
21989  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
21990  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
21991  </code>
21992  Remarks:
21993  Not all features are available on all devices. Refer to the specific device
21994  data sheet for availability.
21995 */
21996 
21997 void
21998  SYS_PORTS_Set (
21999  PORTS_MODULE_ID index ,
22000  PORTS_CHANNEL channel ,
22001  PORTS_DATA_TYPE value ,
22002  PORTS_DATA_MASK mask ) ;
22003 // *****************************************************************************
22004 /* Function:
22005  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22006  PORTS_DATA_MASK clearMask )
22007  Summary:
22008  Clears the selected digital port.
22009  <p><b>Implementation:</b> Dynamic</p>
22010  Description:
22011  This function clears the selected digital port.
22012  Preconditions:
22013  None.
22014  Parameters:
22015  index - Identifier for the device instance to be configured
22016  channel - Identifier for the PORT channel: A, B, C, etc.
22017  clearMask - Identifies the bits to be cleared
22018  Returns:
22019  None.
22020  Example:
22021  <code>
22022  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22023  // application developer.
22024  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22025  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22026  </code>
22027  Remarks:
22028  Not all features are available on all devices. Refer to the specific device
22029  data sheet for availability.
22030 */
22031 
22032 void
22033  SYS_PORTS_Clear (
22034  PORTS_MODULE_ID index ,
22035  PORTS_CHANNEL channel ,
22036  PORTS_DATA_MASK clearMask ) ;
22037 // *****************************************************************************
22038 /* Function:
22039  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22040  SYS_PORTS_PIN_DIRECTION pinDir,
22041  PORTS_CHANNEL channel,
22042  PORTS_DATA_MASK mask )
22043  Summary:
22044  Enables the direction for the selected port.
22045  <p><b>Implementation:</b> Dynamic</p>
22046  Description:
22047  This function enables the direction for the selected port.
22048  Preconditions:
22049  None.
22050  Parameters:
22051  index - Identifier for the device instance to be configured
22052  pinDir - Pin direction
22053  channel - Identifier for the PORT channel: A, B, C, etc.
22054  mask - Mask for the direction of width PORTS_DATA_MASK
22055  Returns:
22056  None
22057  Example:
22058  <code>
22059  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22060  // application developer.
22061  SYS_PORTS_PIN_DIRECTION pinDir;
22062  pinDir = SYS_PORTS_DIRECTION_INPUT;
22063  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22064  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22065  </code>
22066  Remarks:
22067  None.
22068 */
22069 
22070 void
22072  PORTS_MODULE_ID index ,
22073  SYS_PORTS_PIN_DIRECTION pinDir ,
22074  PORTS_CHANNEL channel ,
22075  PORTS_DATA_MASK mask ) ;
22076 // *****************************************************************************
22077 /* Function:
22078  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22079  Summary:
22080  Reads the direction for the selected port.
22081  <p><b>Implementation:</b> Dynamic</p>
22082  Description:
22083  This function reads the direction for the selected port.
22084  Preconditions:
22085  None.
22086  Parameters:
22087  index - Identifier for the device instance to be configured
22088  channel - Identifier for the PORT channel: A, B, C, etc.
22089  Returns:
22090  Direction of the port.
22091  Example:
22092  <code>
22093  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22094  // application developer.
22095  PORTS_DATA_MASK value;
22096  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22097  </code>
22098  Remarks:
22099  None.
22100 */
22101 
22104  PORTS_MODULE_ID index ,
22105  PORTS_CHANNEL channel ) ;
22106 // *****************************************************************************
22107 /* Function:
22108  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22109  PORTS_DATA_MASK toggleMask )
22110  Summary:
22111  Toggles the selected digital port pins.
22112  <p><b>Implementation:</b> Dynamic</p>
22113  Description:
22114  This function toggles the selected digital port pins.
22115  Preconditions:
22116  None.
22117  Parameters:
22118  index - Identifier for the device instance to be configured
22119  channel - Identifier for the PORT channel: A, B, C, etc.
22120  toggleMask - Identifies the bits to be toggled
22121  Returns:
22122  None.
22123  Example:
22124  <code>
22125  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22126  // application developer.
22127  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22128  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22129  </code>
22130  Remarks:
22131  None.
22132 */
22133 
22134 void
22136  PORTS_MODULE_ID index ,
22137  PORTS_CHANNEL channel ,
22138  PORTS_DATA_MASK toggleMask ) ;
22139 // *****************************************************************************
22140 /* Function:
22141  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22142  PORTS_DATA_MASK mask )
22143  Summary:
22144  Enables the open-drain functionality for the selected port.
22145  <p><b>Implementation:</b> Dynamic</p>
22146  Description:
22147  This function enables the open-drain functionality for the selected port.
22148  Preconditions:
22149  None.
22150  Parameters:
22151  index - Identifier for the device instance to be configured
22152  channel - Identifier for the PORT channel: A, B, C, etc.
22153  mask - Mask of type PORTS_DATA_MASK
22154  Returns:
22155  None.
22156  Example:
22157  <code>
22158  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22159  // application developer.
22160  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22161  </code>
22162  Remarks:
22163  Not all features are available on all devices. Refer to the specific device
22164  data sheet for availability.
22165 */
22166 
22167 void
22169  PORTS_MODULE_ID index ,
22170  PORTS_CHANNEL channel ,
22171  PORTS_DATA_MASK mask ) ;
22172 // *****************************************************************************
22173 /* Function:
22174  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22175  PORTS_DATA_MASK mask )
22176  Summary:
22177  Disables the open-drain functionality for the selected port.
22178  <p><b>Implementation:</b> Dynamic</p>
22179  Description:
22180  This function disables the open-drain functionality for the selected port.
22181  Preconditions:
22182  None.
22183  Parameters:
22184  index - Identifier for the device instance to be configured
22185  channel - Identifier for the PORT channel: A, B, C, etc.
22186  mask - Mask of type PORTS_DATA_MASK
22187  Returns:
22188  None.
22189  Example:
22190  <code>
22191  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22192  // application developer.
22193  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22194  </code>
22195  Remarks:
22196  Not all features are available on all devices. Refer to the specific device
22197  data sheet for availability.
22198 */
22199 
22200 void
22202  PORTS_MODULE_ID index ,
22203  PORTS_CHANNEL channel ,
22204  PORTS_DATA_MASK mask ) ;
22205 // *****************************************************************************
22206 /* Function:
22207  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22208  (
22209  PORTS_MODULE_ID index,
22210  PORTS_CHANNEL channel
22211  )
22212  Summary:
22213  Reads the interrupt status from the I/O port.
22214  <p><b>Implementation:</b> Dynamic</p>
22215  Description:
22216  This function reads the interrupt status from the I/O port.
22217  Preconditions:
22218  The interrupts should have been configured.
22219  Parameters:
22220  index - Identifier for the device instance to be configured
22221  channel - Identifier for the PORT channel: A, B, C, etc.
22222  Returns:
22223  Returns the interrupt status of the port channel.
22224  Example:
22225  <code>
22226  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22227  // application developer.
22228  PORTS_DATA_TYPE channelStatus;
22229  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22230  </code>
22231  Remarks:
22232  None.
22233 */
22234 
22237  PORTS_MODULE_ID index ,
22238  PORTS_CHANNEL channel ) ;
22239 // *****************************************************************************
22240 // *****************************************************************************
22241 // Section: SYS PORT PINS REMAPING Routines
22242 // *****************************************************************************
22243 // *****************************************************************************
22244 // *****************************************************************************
22245 /* Function:
22246  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22247  PORTS_REMAP_INPUT_FUNCTION function,
22248  PORTS_REMAP_INPUT_PIN remapPin )
22249  Summary:
22250  Input/Output (I/O) function remapping.
22251  <p><b>Implementation:</b> Dynamic</p>
22252  Description:
22253  This function controls the I/O function remapping.
22254  Precondition:
22255  None.
22256  Parameters:
22257  index - Identifier for the device instance to be configured
22258  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22259  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22260  Returns:
22261  None.
22262  Example:
22263  <code>
22264  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22265  // application developer.
22266  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22267  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22268  </code>
22269  Remarks:
22270  This feature may not be available on all devices. Please refer to the
22271  specific device data sheet to determine availability or use
22272  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22273  this feature is available.
22274 */
22275 
22276 void
22278  PORTS_MODULE_ID index ,
22279  PORTS_REMAP_INPUT_FUNCTION function ,
22280  PORTS_REMAP_INPUT_PIN remapPin ) ;
22281 // *****************************************************************************
22282 /* Function:
22283  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22284  PORTS_REMAP_OUTPUT_FUNCTION function,
22285  PORTS_REMAP_OUTPUT_PIN remapPin )
22286  Summary:
22287  Input/Output (I/O) function remapping.
22288  <p><b>Implementation:</b> Dynamic</p>
22289  Description:
22290  This function controls the I/O function remapping.
22291  Precondition:
22292  None.
22293  Parameters:
22294  index - Identifier for the device instance to be configured
22295  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22296  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22297  Returns:
22298  None.
22299  Example:
22300  <code>
22301  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22302  // application developer.
22303  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22304  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22305  </code>
22306  Remarks:
22307  This feature may not be available on all devices. Please refer to the
22308  specific device data sheet to determine availability or use
22309  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22310  this feature is available.
22311 */
22312 
22313 void
22315  PORTS_MODULE_ID index ,
22316  PORTS_REMAP_OUTPUT_FUNCTION function ,
22317  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22318 // *****************************************************************************
22319 // *****************************************************************************
22320 // Section: SYS Change Notification Pins Routines
22321 // *****************************************************************************
22322 // *****************************************************************************
22323 // *****************************************************************************
22324 /* Function:
22325  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22326  Summary:
22327  Globally enables the change notification for the selected port.
22328  <p><b>Implementation:</b> Dynamic</p>
22329  Description:
22330  This function globally enables the change notification for the selected port.
22331  Preconditions:
22332  None.
22333  Parameters:
22334  None.
22335  Returns:
22336  None.
22337  Example:
22338  <code>
22339  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22340  // application developer.
22341  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22342  </code>
22343  Remarks:
22344  Not all features are available on all devices. Refer to the specific device
22345  data sheet for availability.
22346 */
22347 
22348 void
22350  PORTS_MODULE_ID index ) ;
22351 // *****************************************************************************
22352 /* Function:
22353  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22354  Summary:
22355  Globally disables the change notification for the selected port.
22356  <p><b>Implementation:</b> Dynamic</p>
22357  Description:
22358  This function globally disables the change notification for the selected port.
22359  Preconditions:
22360  None.
22361  Parameters:
22362  None.
22363  Returns:
22364  None.
22365  Example:
22366  <code>
22367  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22368  // application developer.
22369  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22370  </code>
22371  Remarks:
22372  Not all features are available on all devices. Refer to the specific device
22373  data sheet for availability.
22374 */
22375 
22376 void
22378  PORTS_MODULE_ID index ) ;
22379 // *****************************************************************************
22380 /* Function:
22381  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22382  PORTS_CHANGE_NOTICE_PIN pinNum,
22383  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22384  Summary:
22385  Enables the change notification for the selected port.
22386  <p><b>Implementation:</b> Dynamic</p>
22387  Description:
22388  This function enables the change notification for the selected port.
22389  Preconditions:
22390  None.
22391  Parameters:
22392  index - Identifier for the device instance to be configured
22393  value - Pull-up enable or disable value
22394  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22395  Returns:
22396  None.
22397  Example:
22398  <code>
22399  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22400  // application developer.
22401  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22402  PORTS_CHANGE_NOTICE_PIN pinNum;
22403  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22404  </code>
22405  Remarks:
22406  Not all features are available on all devices. Refer to the specific device
22407  data sheet for availability.
22408 */
22409 
22410 void
22412  PORTS_MODULE_ID index ,
22413  PORTS_CHANGE_NOTICE_PIN pinNum ,
22415 // *****************************************************************************
22416 /* Function:
22417  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22418  PORTS_CHANGE_NOTICE_PIN pinNum )
22419  Summary:
22420  Disables the change notification for the selected port.
22421  <p><b>Implementation:</b> Dynamic</p>
22422  Description:
22423  This function disables the change notification for the selected port.
22424  Preconditions:
22425  None.
22426  Parameters:
22427  index - Identifier for the device instance to be configured
22428  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22429  Returns:
22430  None.
22431  Example:
22432  <code>
22433  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22434  // application developer.
22435  PORTS_CHANGE_NOTICE_PIN pinNum;
22436  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22437  </code>
22438  Remarks:
22439  Not all features are available on all devices. Refer to the specific device
22440  data sheet for availability.
22441 */
22442 
22443 void
22445  PORTS_MODULE_ID index ,
22446  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22447 // *****************************************************************************
22448 /* Function:
22449  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22450  Summary:
22451  Enables the change notification for the selected port in Sleep or Idle mode.
22452  <p><b>Implementation:</b> Dynamic</p>
22453  Description:
22454  This function enables the change notification for the selected port in Sleep
22455  or Idle mode.
22456  Preconditions:
22457  None.
22458  Parameters:
22459  None.
22460  Returns:
22461  None.
22462  Example:
22463  <code>
22464  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22465  // application developer.
22466  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22467  </code>
22468  Remarks:
22469  Not all features are available on all devices. Refer to the specific device
22470  data sheet for availability.
22471 */
22472 
22473 void
22475  PORTS_MODULE_ID index ) ;
22476 // *****************************************************************************
22477 /* Function:
22478  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22479  Summary:
22480  Disables the change notification for the selected port in Sleep or Idle mode.
22481  <p><b>Implementation:</b> Dynamic</p>
22482  Description:
22483  This function disables the change notification for the selected port in Sleep
22484  or Idle mode.
22485  Preconditions:
22486  None.
22487  Parameters:
22488  None.
22489  Returns:
22490  None.
22491  Example:
22492  <code>
22493  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22494  // application developer.
22495  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22496  </code>
22497  Remarks:
22498  Not all features are available on all devices. Refer to the specific device
22499  data sheet for availability.
22500 */
22501 
22502 void
22504  PORTS_MODULE_ID index ) ;
22505 // *****************************************************************************
22506 /* Function:
22507  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22508  PORTS_CHANGE_NOTICE_PIN pinNum )
22509  Summary:
22510  Enables a weak pull-up on the change notification pin.
22511  <p><b>Implementation:</b> Dynamic</p>
22512  Description:
22513  This function enables a weak pull-up on the change notification pin.
22514  Preconditions:
22515  None.
22516  Parameters:
22517  index - Identifier for the device instance to be configured
22518  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22519  Returns:
22520  None.
22521  Example:
22522  <code>
22523  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22524  // application developer.
22525  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22526  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22527  </code>
22528  Remarks:
22529  Not all features are available on all devices. Refer to the specific device
22530  data sheet for availability.
22531 */
22532 
22533 void
22535  PORTS_MODULE_ID index ,
22536  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22537 // *****************************************************************************
22538 /* Function:
22539  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22540  PORTS_CHANGE_NOTICE_PIN pinNum )
22541  Summary:
22542  Disables a weak pull-up on the change notification pin.
22543  <p><b>Implementation:</b> Dynamic</p>
22544  Description:
22545  This function Disables a weak pull-up on the change notification pin.
22546  Preconditions:
22547  None.
22548  Parameters:
22549  index - Identifier for the device instance to be configured
22550  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22551  Returns:
22552  None.
22553  Example:
22554  <code>
22555  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22556  // application developer.
22557  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22558  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
22559  </code>
22560  Remarks:
22561  Not all features are available on all devices. Refer to the specific device
22562  data sheet for availability.
22563 */
22564 
22565 void
22567  PORTS_MODULE_ID index ,
22568  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22569 // *****************************************************************************
22570 // *****************************************************************************
22571 // Section: SYS PORT PINS Control Routines
22572 // *****************************************************************************
22573 // *****************************************************************************
22574 // *****************************************************************************
22575 /* Function:
22576  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
22577  PORTS_ANALOG_PIN pin,
22578  PORTS_PIN_MODE mode)
22579  Summary:
22580  Enables the selected pin as analog or digital.
22581  <p><b>Implementation:</b> Dynamic</p>
22582  Description:
22583  This function enables the selected pin as analog or digital.
22584  Preconditions:
22585  None.
22586  Parameters:
22587  index - Identifier for the device instance to be configured
22588  pin - Possible values of PORTS_ANALOG_PIN
22589  mode - Possible values of PORTS_PIN_MODE
22590  Returns:
22591  None.
22592  Example:
22593  <code>
22594  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22595  // application developer.
22596  // MY_PIN - PORTS_ANALOG_PIN_AN0
22597  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
22598  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
22599  </code>
22600  Remarks:
22601  Not all features are available on all devices. Refer to the specific device
22602  data sheet for availability.
22603 */
22604 
22605 void
22607  PORTS_MODULE_ID index ,
22608  PORTS_ANALOG_PIN pin ,
22609  PORTS_PIN_MODE mode ) ;
22610 // *****************************************************************************
22611 /* Function:
22612  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
22613  PORTS_CHANNEL channel,
22614  PORTS_BIT_POS bitPos
22615  bool value )
22616  Summary:
22617  Writes the selected digital pin.
22618  <p><b>Implementation:</b> Dynamic</p>
22619  Description:
22620  This function writes the selected digital pin.
22621  Preconditions:
22622  None.
22623  Parameters:
22624  index - Identifier for the device instance to be configured
22625  channel - Identifier for the PORT channel: A, B, C, etc.
22626  bitPos - Possible values of PORTS_BIT_POS
22627  value - Value to be written to the specific pin/latch:
22628  - true - Sets the bit
22629  - false - Clears the bit
22630  Returns:
22631  None.
22632  Example:
22633  <code>
22634  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22635  // application developer.
22636  // MY_PINNUM - PORTS_PIN_10
22637  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
22638  </code>
22639  Remarks:
22640  Not all features are available on all devices. Refer to the specific device
22641  data sheet for availability.
22642 */
22643 
22644 void
22646  PORTS_MODULE_ID index ,
22647  PORTS_CHANNEL channel ,
22648  PORTS_BIT_POS bitPos ,
22649  bool value ) ;
22650 // *****************************************************************************
22651 /* Function:
22652  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
22653  PORTS_CHANNEL channel,
22654  PORTS_BIT_POS bitPos )
22655  Summary:
22656  Reads the data driven on the selected digital pin.
22657  <p><b>Implementation:</b> Dynamic</p>
22658  Description:
22659  This function reads the data driven on the selected
22660  digital output pin.
22661  Preconditions:
22662  None.
22663  Parameters:
22664  index - Identifier for the device instance to be configured
22665  channel - Identifier for the PORT channel: A, B, C, etc.
22666  bitPos - Possible values of PORTS_BIT_POS
22667  Returns:
22668  The status of the data driven on the port pin.
22669  Example:
22670  <code>
22671  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22672  // application developer.
22673  // MY_PINNUM - PORTS_PIN_10
22674  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22675  </code>
22676  Remarks:
22677  Not all features are available on all devices. Refer to the specific device
22678  data sheet for availability.
22679 */
22680 
22681 bool
22683  PORTS_MODULE_ID index ,
22684  PORTS_CHANNEL channel ,
22685  PORTS_BIT_POS bitPos ) ;
22686 // *****************************************************************************
22687 /* Function:
22688  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
22689  PORTS_CHANNEL channel,
22690  PORTS_BIT_POS bitPos )
22691  Summary:
22692  Reads the selected digital pin.
22693  <p><b>Implementation:</b> Dynamic</p>
22694  Description:
22695  This function reads the selected digital pin, not the Latch.
22696  Preconditions:
22697  None.
22698  Parameters:
22699  index - Identifier for the device instance to be configured
22700  channel - Identifier for the PORT channel: A, B, C, etc.
22701  bitPos - Possible values of PORTS_BIT_POS
22702  Returns:
22703  The status of the port pin.
22704  Example:
22705  <code>
22706  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22707  // application developer.
22708  // MY_PINNUM - PORTS_PIN_10
22709  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22710  </code>
22711  Remarks:
22712  Not all features are available on all devices. Refer to the specific device
22713  data sheet for availability.
22714 */
22715 
22716 bool
22718  PORTS_MODULE_ID index ,
22719  PORTS_CHANNEL channel ,
22720  PORTS_BIT_POS bitPos ) ;
22721 // *****************************************************************************
22722 /* Function:
22723  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
22724  PORTS_CHANNEL channel,
22725  PORTS_BIT_POS bitPos )
22726  Summary:
22727  Toggles the selected digital pin.
22728  <p><b>Implementation:</b> Dynamic</p>
22729  Description:
22730  This function toggles the selected digital pin.
22731  Preconditions:
22732  None.
22733  Parameters:
22734  index - Identifier for the device instance to be configured
22735  channel - Identifier for the PORT channel: A, B, C, etc.
22736  bitPos - Possible values of PORTS_BIT_POS
22737  Returns:
22738  None.
22739  Example:
22740  <code>
22741  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22742  // application developer.
22743  // MY_PINNUM - PORTS_PIN_10
22744  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22745  </code>
22746  Remarks:
22747  Not all features are available on all devices. Refer to the specific device
22748  data sheet for availability.
22749 */
22750 
22751 void
22753  PORTS_MODULE_ID index ,
22754  PORTS_CHANNEL channel ,
22755  PORTS_BIT_POS bitPos ) ;
22756 // *****************************************************************************
22757 /* Function:
22758  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
22759  PORTS_CHANNEL channel,
22760  PORTS_BIT_POS bitPos )
22761  Summary:
22762  Sets the selected digital pin/latch.
22763  <p><b>Implementation:</b> Dynamic</p>
22764  Description:
22765  This function sets the selected digital pin/latch.
22766  Preconditions:
22767  None.
22768  Parameters:
22769  index - Identifier for the device instance to be configured
22770  channel - Identifier for the PORT channel: A, B, C, etc.
22771  bitPos - Possible values of PORTS_BIT_POS
22772  Returns:
22773  None.
22774  Example:
22775  <code>
22776  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22777  // application developer.
22778  // MY_PINNUM - PORTS_PIN_10
22779  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22780  </code>
22781  Remarks:
22782  Not all features are available on all devices. Refer to the specific device
22783  data sheet for availability.
22784 */
22785 
22786 void
22788  PORTS_MODULE_ID index ,
22789  PORTS_CHANNEL channel ,
22790  PORTS_BIT_POS bitPos ) ;
22791 // *****************************************************************************
22792 /* Function:
22793  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
22794  PORTS_CHANNEL channel,
22795  PORTS_BIT_POS bitPos )
22796  Summary:
22797  Clears the selected digital pin.
22798  <p><b>Implementation:</b> Dynamic</p>
22799  Description:
22800  This function clears the selected digital pin.
22801  Preconditions:
22802  None.
22803  Parameters:
22804  index - Identifier for the device instance to be configured
22805  channel - Identifier for the PORT channel: A, B, C, etc.
22806  bitPos - Possible values of PORTS_BIT_POS
22807  Returns:
22808  None.
22809  Example:
22810  <code>
22811  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22812  // application developer.
22813  // MY_PINNUM - PORTS_IO_PIN_10
22814  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22815  </code>
22816  Remarks:
22817  Not all features are available on all devices. Refer to the specific device
22818  data sheet for availability.
22819 */
22820 
22821 void
22823  PORTS_MODULE_ID index ,
22824  PORTS_CHANNEL channel ,
22825  PORTS_BIT_POS bitPos ) ;
22826 // *****************************************************************************
22827 /* Function:
22828  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
22829  SYS_PORTS_PIN_DIRECTION pinDir,
22830  PORTS_CHANNEL channel,
22831  PORTS_BIT_POS bitPos )
22832  Summary:
22833  Enables the direction for the selected pin.
22834  <p><b>Implementation:</b> Dynamic</p>
22835  Description:
22836  This function enables the direction for the selected pin.
22837  Preconditions:
22838  None.
22839  Parameters:
22840  index - Identifier for the device instance to be configured
22841  pinDir - Pin direction
22842  channel - Identifier for the PORT channel: A, B, C, etc.
22843  bitPos - Possible values of PORTS_BIT_POS
22844  Returns:
22845  None.
22846  Example:
22847  <code>
22848  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22849  // application developer.
22850  // MY_PINNUM - PORTS_PIN_10
22851  SYS_PORTS_PIN_DIRECTION pinDir;
22852  pinDir = SYS_PORTS_DIRECTION_INPUT;
22853  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
22854  </code>
22855  Remarks:
22856  Not all features are available on all devices. Refer to the specific device
22857  data sheet for availability.
22858 */
22859 
22860 void
22862  PORTS_MODULE_ID index ,
22863  SYS_PORTS_PIN_DIRECTION pinDir ,
22864  PORTS_CHANNEL channel ,
22865  PORTS_BIT_POS bitPos ) ;
22866 // *****************************************************************************
22867 /* Function:
22868  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
22869  PORTS_CHANNEL channel,
22870  PORTS_BIT_POS bitPos )
22871  Summary:
22872  Enables the open-drain functionality for the selected pin.
22873  <p><b>Implementation:</b> Dynamic</p>
22874  Description:
22875  This function enables the open-drain functionality for the selected pin.
22876  Preconditions:
22877  None.
22878  Parameters:
22879  index - Identifier for the device instance to be configured
22880  channel - Identifier for the PORT channel: A, B, C, etc.
22881  bitPos - Possible values of PORTS_BIT_POS
22882  Returns:
22883  None.
22884  Example:
22885  <code>
22886  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22887  // application developer.
22888  // MY_PINNUM - PORTS_PIN_10
22889  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22890  </code>
22891  Remarks:
22892  Not all features are available on all devices. Refer to the specific device
22893  data sheet for availability.
22894 */
22895 
22896 void
22898  PORTS_MODULE_ID index ,
22899  PORTS_CHANNEL channel ,
22900  PORTS_BIT_POS bitPos ) ;
22901 // *****************************************************************************
22902 /* Function:
22903  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
22904  PORTS_CHANNEL channel,
22905  PORTS_BIT_POS bitPos )
22906  Summary:
22907  Disables the open-drain functionality for the selected pin.
22908  <p><b>Implementation:</b> Dynamic</p>
22909  Description:
22910  This function disables the open-drain functionality for the selected pin.
22911  Preconditions:
22912  None.
22913  Parameters:
22914  index - Identifier for the device instance to be configured
22915  channel - Identifier for the PORT channel: A, B, C, etc.
22916  bitPos - Possible values of PORTS_BIT_POS
22917  Returns:
22918  None.
22919  Example:
22920  <code>
22921  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22922  // application developer.
22923  // MY_PINNUM - PORTS_PIN_10
22924  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22925  </code>
22926  Remarks:
22927  Not all features are available on all devices. Refer to the specific device
22928  data sheet for availability.
22929 */
22930 
22931 void
22933  PORTS_MODULE_ID index ,
22934  PORTS_CHANNEL channel ,
22935  PORTS_BIT_POS bitPos ) ;
22936 // *****************************************************************************
22937 /* Function:
22938  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
22939  PORTS_CHANNEL channel,
22940  PORTS_BIT_POS bitPos )
22941  Summary:
22942  Enables the pull-up functionality for the selected pin.
22943  <p><b>Implementation:</b> Dynamic</p>
22944  Description:
22945  This function enables the pull-up functionality for the selected pin.
22946  Preconditions:
22947  None.
22948  Parameters:
22949  index - Identifier for the device instance to be configured
22950  channel - Identifier for the PORT channel: A, B, C, etc.
22951  bitPos - Possible values of PORTS_BIT_POS
22952  Returns:
22953  None.
22954  Example:
22955  <code>
22956  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22957  // application developer.
22958  // MY_PINNUM - PORTS_PIN_10
22959  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22960  </code>
22961  Remarks:
22962  Not all features are available on all devices. Refer to the specific device
22963  data sheet for availability.
22964 */
22965 
22966 void
22968  PORTS_MODULE_ID index ,
22969  PORTS_CHANNEL channel ,
22970  PORTS_BIT_POS bitPos ) ;
22971 // *****************************************************************************
22972 /* Function:
22973  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
22974  PORTS_CHANNEL channel,
22975  PORTS_BIT_POS bitPos )
22976  Summary:
22977  Disables the pull-up functionality for the selected pin.
22978  <p><b>Implementation:</b> Dynamic</p>
22979  Description:
22980  This function disables the pull-up functionality for the selected pin.
22981  Preconditions:
22982  None.
22983  Parameters:
22984  index - Identifier for the device instance to be configured
22985  channel - Identifier for the PORT channel: A, B, C, etc.
22986  bitPos - Possible values of PORTS_BIT_POS
22987  Returns:
22988  None.
22989  Example:
22990  <code>
22991  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22992  // application developer.
22993  // MY_PINNUM - PORTS_PIN_10
22994  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22995  </code>
22996  Remarks:
22997  Not all features are available on all devices. Refer to the specific device
22998  data sheet for availability.
22999 */
23000 
23001 void
23003  PORTS_MODULE_ID index ,
23004  PORTS_CHANNEL channel ,
23005  PORTS_BIT_POS bitPos ) ;
23006 // *****************************************************************************
23007 /* Function:
23008  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23009  PORTS_CHANNEL channel,
23010  PORTS_BIT_POS bitPos )
23011  Summary:
23012  Enables the pull-down functionality for the selected pin.
23013  <p><b>Implementation:</b> Dynamic</p>
23014  Description:
23015  This function enables the pull-down functionality for the selected pin.
23016  Preconditions:
23017  None.
23018  Parameters:
23019  index - Identifier for the device instance to be configured
23020  channel - Identifier for the PORT channel: A, B, C, etc.
23021  bitPos - Possible values of PORTS_BIT_POS
23022  Returns:
23023  None.
23024  Example:
23025  <code>
23026  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23027  // application developer.
23028  // MY_PINNUM - PORTS_PIN_10
23029  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23030  </code>
23031  Remarks:
23032  Not all features are available on all devices. Refer to the specific device
23033  data sheet for availability.
23034 */
23035 
23036 void
23038  PORTS_MODULE_ID index ,
23039  PORTS_CHANNEL channel ,
23040  PORTS_BIT_POS bitPos ) ;
23041 // *****************************************************************************
23042 /* Function:
23043  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23044  PORTS_CHANNEL channel,
23045  PORTS_BIT_POS bitPos )
23046  Summary:
23047  Disables the pull-down functionality for the selected pin.
23048  <p><b>Implementation:</b> Dynamic</p>
23049  Description:
23050  This function disables the pull-down functionality for the selected pin.
23051  Preconditions:
23052  None.
23053  Parameters:
23054  index - Identifier for the device instance to be configured
23055  channel - Identifier for the PORT channel: A, B, C, etc.
23056  bitPos - Possible values of PORTS_BIT_POS
23057  Returns:
23058  None.
23059  Example:
23060  <code>
23061  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23062  // application developer.
23063  // MY_PINNUM - PORTS_PIN_10
23064  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23065  </code>
23066  Remarks:
23067  Not all features are available on all devices. Refer to the specific device
23068  data sheet for availability.
23069 */
23070 
23071 void
23073  PORTS_MODULE_ID index ,
23074  PORTS_CHANNEL channel ,
23075  PORTS_BIT_POS bitPos ) ;
23076 //******************************************************************************
23077 /* Function:
23078  void SYS_PORTS_InterruptEnable
23079  (
23080  PORTS_MODULE_ID index,
23081  PORTS_CHANNEL channel,
23082  PORTS_BIT_POS bitPos,
23083  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23084  )
23085  Summary:
23086  Enables the selected interrupt for the selected port pin.
23087  Description:
23088  This function enables the selected interrupt for the selected port pin.
23089  Preconditions:
23090  Select the pull-up or pull-down as required.
23091  Parameters:
23092  index - Identifier for the device instance to be configured
23093  channel - Identifier for the PORT channel: A, B, C, etc.
23094  bitPos - Possible values of PORTS_BIT_POS
23095  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23096  Returns:
23097  None.
23098  Example:
23099  <code>
23100  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23101  </code>
23102  Remarks:
23103  None.
23104 */
23105 
23106 void
23108  PORTS_MODULE_ID index ,
23109  PORTS_CHANNEL channel ,
23110  PORTS_BIT_POS bitPos ,
23111  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23112 //DOM-IGNORE-BEGIN
23113 //DOM-IGNORE-END
23114  //SYS_PORTS_H
23115 /*******************************************************************************
23116  End of File
23117 */
23118 
23119 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23120 /* CLOSE_FILE Include File */
23121 
23122 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23123 /*******************************************************************************
23124  SPI Driver Interface
23125  Company:
23126  Microchip Technology Inc.
23127  File Name:
23128  drv_spi.h
23129  Summary:
23130  SPI device driver interface file.
23131  Description:
23132  The SPI driver provides a simple interface to manage the SPI module.
23133  This file defines the interface definitions and prototypes for the SPI driver.
23134 *******************************************************************************/
23135 //DOM-IGNORE-BEGIN
23136 /*******************************************************************************
23137 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23138 Microchip licenses to you the right to use, modify, copy and distribute
23139 Software only when embedded on a Microchip microcontroller or digital signal
23140 controller that is integrated into your product or third party product
23141 (pursuant to the sublicense terms in the accompanying license agreement).
23142 You should refer to the license agreement accompanying this Software for
23143 additional information regarding your rights and obligations.
23144 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23145 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23146 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23147 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23148 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23149 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23150 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23151 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23152 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23153 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23154 *******************************************************************************/
23155 //DOM-IGNORE-END
23156 #ifndef _DRV_SPI_H
23157 #define _DRV_SPI_H
23158 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23159 /*******************************************************************************
23160  SPI Driver Interface
23161  Company:
23162  Microchip Technology Inc.
23163  File Name:
23164  drv_spi_definitions.h
23165  Summary:
23166  SPI device driver interface file.
23167  Description:
23168  The SPI driver provides a simple interface to manage the SPI module.
23169  This file defines the interface definitions and prototypes for the SPI
23170  driver.
23171 *******************************************************************************/
23172 //DOM-IGNORE-BEGIN
23173 /*******************************************************************************
23174 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23175 Microchip licenses to you the right to use, modify, copy and distribute
23176 Software only when embedded on a Microchip microcontroller or digital signal
23177 controller that is integrated into your product or third party product
23178 (pursuant to the sublicense terms in the accompanying license agreement).
23179 You should refer to the license agreement accompanying this Software for
23180 additional information regarding your rights and obligations.
23181 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23182 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23183 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23184 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23185 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23186 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23187 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23188 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23189 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23190 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23191 *******************************************************************************/
23192 //DOM-IGNORE-END
23193 #ifndef _DRV_SPI_DEFINITIONS_H
23194 #define _DRV_SPI_DEFINITIONS_H
23195 // *****************************************************************************
23196 // *****************************************************************************
23197 // Section: Data Types
23198 // *****************************************************************************
23199 // *****************************************************************************
23200 #include <stdint.h>
23201 #include <stdbool.h>
23202 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23203 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23204 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23205 /*******************************************************************************
23206  SPI Peripheral Library Interface Header
23207  Company:
23208  Microchip Technology Inc.
23209  File Name:
23210  plib_spi.h
23211  Summary:
23212  SPI Peripheral Library Interface Header for common definitions.
23213  Description:
23214  This header file contains the function prototypes and definitions of
23215  the data types and constants that make up the interface to the SPI
23216  PLIB.
23217  *******************************************************************************/
23218 // DOM-IGNORE-BEGIN
23219 /*******************************************************************************
23220 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23221 Microchip licenses to you the right to use, modify, copy and distribute
23222 Software only when embedded on a Microchip microcontroller or digital signal
23223 controller that is integrated into your product or third party product
23224 (pursuant to the sublicense terms in the accompanying license agreement).
23225 You should refer to the license agreement accompanying this Software for
23226 additional information regarding your rights and obligations.
23227 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23228 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23229 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23230 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23231 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23232 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23233 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23234 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23235 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23236 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23237  *******************************************************************************/
23238 // DOM-IGNORE-END
23239 #ifndef _PLIB_SPI_H
23240 #define _PLIB_SPI_H
23241 // DOM-IGNORE-BEGIN
23242 // DOM-IGNORE-END
23243 // *****************************************************************************
23244 // *****************************************************************************
23245 // Section: Included Files (continued at end of file)
23246 // *****************************************************************************
23247 // *****************************************************************************
23248 /* This section lists the other files that are included in this file. However,
23249  please see the end of the file for additional implementation header files
23250  that are also included.
23251  */
23252 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23253 //DOM-IGNORE-BEGIN
23254 /*******************************************************************************
23255 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23256 Microchip licenses to you the right to use, modify, copy and distribute
23257 Software only when embedded on a Microchip microcontroller or digital signal
23258 controller that is integrated into your product or third party product
23259 (pursuant to the sublicense terms in the accompanying license agreement).
23260 You should refer to the license agreement accompanying this Software for
23261 additional information regarding your rights and obligations.
23262 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23263 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23264 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23265 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23266 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23267 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23268 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23269 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23270 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23271 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23272  *******************************************************************************/
23273 //DOM-IGNORE-END
23274 #ifndef _PLIB_SPI_PROCESSOR_H
23275 #define _PLIB_SPI_PROCESSOR_H
23276 #error "Can't find header"
23277 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23278 /* CLOSE_FILE Include File */
23279 
23280 // *****************************************************************************
23281 // *****************************************************************************
23282 // Section: Constants & Data Types
23283 // *****************************************************************************
23284 // *****************************************************************************
23285 // *****************************************************************************
23286 // *****************************************************************************
23287 // Section: SPI Peripheral Library Interface Routines
23288 // *****************************************************************************
23289 // *****************************************************************************
23290 //******************************************************************************
23291 /* Function:
23292  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23293  Summary:
23294  Enables the SPI module.
23295  Description:
23296  This function enables the SPI module.
23297  This operation is atomic.
23298  Precondition:
23299  None.
23300  Parameters:
23301  index - Identifier for the device instance to be configured
23302  Returns:
23303  None.
23304  Example:
23305  <code>
23306  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23307  // application developer.
23308  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23309  </code>
23310  Remarks:
23311  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23312  before use.
23313  This function implements an operation of the enable control feature. This
23314  feature may not be available on all devices. Please refer to the specific
23315  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23316  in your application to automatically determine whether this feature is available.
23317  */
23318 
23319 void
23320  PLIB_SPI_Enable (
23321  SPI_MODULE_ID index ) ;
23322 //******************************************************************************
23323 /* Function:
23324  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23325  Summary:
23326  Disables the SPI module.
23327  Description:
23328  This function disables the SPI module.
23329  This operation is atomic.
23330  Precondition:
23331  None.
23332  Parameters:
23333  index - Identifier for the device instance to be configured
23334  Returns:
23335  None.
23336  Example:
23337  <code>
23338  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23339  // application developer.
23340  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23341  </code>
23342  Remarks:
23343  This function implements an operation of the enable control feature. This
23344  feature may not be available on all devices. Please refer to the specific
23345  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23346  in your application to automatically determine whether this feature is available.
23347  */
23348 
23349 void
23351  SPI_MODULE_ID index ) ;
23352 //******************************************************************************
23353 /* Function:
23354  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23355  Summary:
23356  Discontinues module operation when the device enters Idle mode.
23357  Description:
23358  This function sets up the SPI module such that module operation is disabled
23359  when the device enters Idle mode.
23360  This operation is atomic.
23361  Precondition:
23362  None.
23363  Parameters:
23364  index - Identifier for the device instance to be configured
23365  Returns:
23366  None.
23367  Example:
23368  <code>
23369  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23370  // application developer.
23371  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23372  </code>
23373  Remarks:
23374  This function implements an operation of the stop in idle control feature.
23375  This feature may not be available on all devices. Please refer to the
23376  specific device data sheet to determine availability or use
23377  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23378  determine if this feature is available.
23379  */
23380 
23381 void
23383  SPI_MODULE_ID index ) ;
23384 //******************************************************************************
23385 /* Function:
23386  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23387  Summary:
23388  Continues module operation when the device enters Idle mode.
23389  Description:
23390  This function sets up the SPI module such that module operation is continued
23391  when the device enters Idle mode.
23392  This operation is atomic.
23393  Precondition:
23394  None.
23395  Parameters:
23396  index - Identifier for the device instance to be configured
23397  Returns:
23398  None.
23399  Example:
23400  <code>
23401  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23402  // application developer.
23403  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23404  </code>
23405  Remarks:
23406  This function implements an operation of the stop in idle control feature.
23407  This feature may not be available on all devices. Please refer to the
23408  specific device data sheet to determine availability or use
23409  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23410  this feature is available.
23411  */
23412 
23413 void
23415  SPI_MODULE_ID index ) ;
23416 //******************************************************************************
23417 /* Function:
23418  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23419  Summary:
23420  Returns the current status of the SPI receiver overflow.
23421  Description:
23422  This function returns the current status of the SPI receiver overflow.
23423  This operation is atomic.
23424  Precondition:
23425  None.
23426  Parameters:
23427  index - Identifier for the device instance to be configured
23428  Returns:
23429  SPI receiver overflow status:
23430  - true - A new byte/word is completely received and discarded.
23431  The user software has not read the previous data in
23432  the SPI buffer register.
23433  - false - No Overflow has occurred
23434  Example:
23435  <code>
23436  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23437  // application developer.
23438  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23439  </code>
23440  Remarks:
23441  This function implements an operation of the receiver overflow status feature.
23442  This feature may not be available on all devices. Please refer to the
23443  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23444  in your application to automatically determine whether this feature is available.
23445  */
23446 
23447 bool
23449  SPI_MODULE_ID index ) ;
23450 //******************************************************************************
23451 /* Function:
23452  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23453  Summary:
23454  Clears the SPI receive overflow flag.
23455  Description:
23456  This function clears the SPI receive overflow flag.
23457  This operation is atomic.
23458  Precondition:
23459  None.
23460  Parameters:
23461  index - Identifier for the device instance to be configured
23462  Returns:
23463  None.
23464  Example:
23465  <code>
23466  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23467  // application developer.
23468  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23469  </code>
23470  Remarks:
23471  This function implements an operation of the receiver overflow status feature.
23472  This feature may not be available on all devices. Please refer to the
23473  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23474  in your application to automatically determine whether this feature is available.
23475  */
23476 
23477 void
23479  SPI_MODULE_ID index ) ;
23480 //******************************************************************************
23481 /* Function:
23482  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23483  Summary:
23484  Returns the current transmit buffer status of the SPI module.
23485  Description:
23486  This function returns the current transmit buffer status of the SPI module.
23487  This operation is atomic.
23488  Precondition:
23489  None.
23490  Parameters:
23491  index - Identifier for the device instance to be configured
23492  Returns:
23493  - true - Transmit not yet started, transmit buffer is full
23494  - false - Transmit started, transmit buffer is empty/not full
23495  Example:
23496  <code>
23497  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23498  // application developer.
23499  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23500  </code>
23501  Remarks:
23502  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23503  occur, loading the transmit buffer. Automatically cleared in hardware when
23504  the SPI module transfers data from the transmit buffer to the shift register.
23505  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23506  occur, loading the last available buffer. Automatically cleared in hardware
23507  when the buffer is available for writing.
23508  This function implements an operation of the transmit buffer status feature.
23509  This feature may not be available on all devices. Please refer to the
23510  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23511  in your application to automatically determine whether this feature is available.
23512  */
23513 
23514 bool
23516  SPI_MODULE_ID index ) ;
23517 //******************************************************************************
23518 /* Function:
23519  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23520  Summary:
23521  Returns the current status of the SPI receive buffer.
23522  Description:
23523  This function returns the current status of the SPI receive buffer.
23524  This operation is atomic.
23525  Precondition:
23526  None.
23527  Parameters:
23528  index - Identifier for the device instance to be configured
23529  Returns:
23530  Receiver Buffer Full Status:
23531  - true - Receive complete, receive buffer is full
23532  - false - Receive is not complete, receive buffer is empty
23533  Example:
23534  <code>
23535  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23536  // application developer.
23537  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23538  </code>
23539  Remarks:
23540  In Standard Buffer mode - automatically set in hardware when the SPI module
23541  transfers data from the shift register to the receive buffer. Automatically
23542  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23543  In Enhanced Buffer mode - automatically set in hardware when the SPI module
23544  transfers data from the shift register to the receive buffer, filling the
23545  last unread buffer. Automatically cleared in hardware when a buffer is available
23546  for a transfer from the shift register.
23547  This function implements an operation of the receiver buffer status feature.
23548  This feature may not be available on all devices. Please refer to the
23549  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
23550  in your application to automatically determine whether this feature is available.
23551  */
23552 
23553 bool
23555  SPI_MODULE_ID index ) ;
23556 //******************************************************************************
23557 /* Function:
23558  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
23559  Summary:
23560  Enables the selected SPI pins.
23561  Description:
23562  This function enables the selected SPI pins.
23563  Precondition:
23564  None.
23565  Parameters:
23566  index - Identifier for the device instance to be configured
23567  pin - One of the SPI_PIN enumeration values as the SPI pin
23568  Returns:
23569  None.
23570  Example:
23571  <code>
23572  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23573  // application developer.
23574  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23575  </code>
23576  Remarks:
23577  This function implements an operation of the pin control feature.
23578  This feature may not be available on all devices. Please refer to the
23579  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23580  in your application to automatically determine whether this feature is available.
23581  */
23582 
23583 void
23585  SPI_MODULE_ID index ,
23586  SPI_PIN pin ) ;
23587 //******************************************************************************
23588 /* Function:
23589  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
23590  Summary:
23591  Enables the selected SPI pins.
23592  Description:
23593  This function enables the selected SPI pins.
23594  Precondition:
23595  None.
23596  Parameters:
23597  index - Identifier for the device instance to be configured
23598  pin - One of the SPI_PIN enumeration values as the SPI pin
23599  Returns:
23600  None.
23601  Example:
23602  <code>
23603  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23604  // application developer.
23605  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23606  </code>
23607  Remarks:
23608  This function implements an operation of the pin control feature.
23609  This feature may not be available on all devices. Please refer to the
23610  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23611  in your application to automatically determine whether this feature is available.
23612  */
23613 
23614 void
23616  SPI_MODULE_ID index ,
23617  SPI_PIN pin ) ;
23618 //******************************************************************************
23619 /* Function:
23620  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
23621  SPI_COMMUNICATION_WIDTH width )
23622  Summary:
23623  Selects the data width for the SPI communication.
23624  Description:
23625  This function selects the data width for the SPI communication.
23626  This operation is atomic.
23627  Precondition:
23628  None.
23629  Parameters:
23630  index - Identifier for the device instance to be configured
23631  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
23632  SPI buffer width
23633  Returns:
23634  None.
23635  Example:
23636  <code>
23637  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23638  // application developer.
23639  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
23640  </code>
23641  Remarks:
23642  This function implements an operation of the communication width feature.
23643  This feature may not be available on all devices. Please refer to the
23644  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
23645  in your application to automatically determine whether this feature is available.
23646  */
23647 
23648 void
23650  SPI_MODULE_ID index ,
23651  SPI_COMMUNICATION_WIDTH width ) ;
23652 //******************************************************************************
23653 /* Function:
23654  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
23655  SPI_AUDIO_COMMUNICATION_WIDTH width )
23656  Summary:
23657  Selects the data width for the SPI audio communication.
23658  Description:
23659  This function selects the data width for the SPI audio communication.
23660  This operation is atomic.
23661  Precondition:
23662  None.
23663  Parameters:
23664  index - Identifier for the device instance to be configured
23665  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
23666  SPI buffer width
23667  Returns:
23668  None.
23669  Example:
23670  <code>
23671  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23672  // application developer.
23673  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
23674  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
23675  </code>
23676  Remarks:
23677  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
23678  This function implements an operation of the audio communication width feature.
23679  This feature may not be available on all devices. Please refer to the
23680  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
23681  in your application to automatically determine whether this feature is available.
23682  */
23683 
23684 void
23686  SPI_MODULE_ID index ,
23687  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
23688 //******************************************************************************
23689 /* Function:
23690  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
23691  SPI_INPUT_SAMPLING_PHASE phase)
23692  Summary:
23693  Selects the SPI data input sample phase.
23694  Description:
23695  This function selects the input sampling phase in Master mode.
23696  Precondition:
23697  None.
23698  Parameters:
23699  index - Identifier for the device instance to be configured
23700  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
23701  sampling phase
23702  Returns:
23703  None.
23704  Example:
23705  <code>
23706  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23707  // application developer.
23708  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
23709  </code>
23710  Remarks:
23711  This function implements an operation of the input sample phase feature.
23712  This feature may not be available on all devices. Please refer to the
23713  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
23714  in your application to automatically determine whether this feature is available.
23715  */
23716 
23717 void
23719  SPI_MODULE_ID index ,
23720  SPI_INPUT_SAMPLING_PHASE phase ) ;
23721 //******************************************************************************
23722 /* Function:
23723  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
23724  SPI_OUTPUT_DATA_PHASE data)
23725  Summary:
23726  Selects serial output data change.
23727  Description:
23728  This function selects serial output data change.
23729  Precondition:
23730  None.
23731  Parameters:
23732  index - Identifier for the device instance to be configured
23733  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
23734  SPI serial output data change
23735  Returns:
23736  None.
23737  Example:
23738  <code>
23739  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23740  // application developer.
23741  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
23742  </code>
23743  Remarks:
23744  This function implements an operation of the output data phase feature.
23745  This feature may not be available on all devices. Please refer to the
23746  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
23747  in your application to automatically determine whether this feature is available.
23748  */
23749 
23750 void
23752  SPI_MODULE_ID index ,
23753  SPI_OUTPUT_DATA_PHASE phase ) ;
23754 //******************************************************************************
23755 /* Function:
23756  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
23757  SPI_CLOCK_POLARITY polarity)
23758  Summary:
23759  Enables clock polarity.
23760  Description:
23761  This function enables clock polarity.
23762  Precondition:
23763  None.
23764  Parameters:
23765  index - Identifier for the device instance to be configured
23766  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
23767  Returns:
23768  None.
23769  Example:
23770  <code>
23771  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23772  // application developer.
23773  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
23774  </code>
23775  Remarks:
23776  This function implements an operation of the clock polarity feature.
23777  This feature may not be available on all devices. Please refer to the
23778  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
23779  in your application to automatically determine whether this feature is available.
23780  */
23781 
23782 void
23784  SPI_MODULE_ID index ,
23785  SPI_CLOCK_POLARITY polarity ) ;
23786 //******************************************************************************
23787 /* Function:
23788  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
23789  Summary:
23790  Enables the SPI in Master mode.
23791  Description:
23792  This function enables the SPI in Master mode.
23793  This operation is atomic.
23794  Precondition:
23795  None.
23796  Parameters:
23797  index - Identifier for the device instance to be configured
23798  Returns:
23799  None.
23800  Example:
23801  <code>
23802  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23803  // application developer.
23804  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
23805  </code>
23806  Remarks:
23807  This function implements an operation of the master enable control feature.
23808  This feature may not be available on all devices. Please refer to the
23809  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23810  in your application to automatically determine whether this feature is available.
23811  */
23812 
23813 void
23815  SPI_MODULE_ID index ) ;
23816 //******************************************************************************
23817 /* Function:
23818  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
23819  Summary:
23820  Enables the SPI in Slave mode.
23821  Description:
23822  This function enables the SPI in Slave mode.
23823  This operation is atomic.
23824  Precondition:
23825  None.
23826  Parameters:
23827  index - Identifier for the device instance to be configured
23828  Returns:
23829  None.
23830  Example:
23831  <code>
23832  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23833  // application developer.
23834  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
23835  </code>
23836  Remarks:
23837  This function implements an operation of the master enable control feature.
23838  This feature may not be available on all devices. Please refer to the
23839  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23840  in your application to automatically determine whether this feature is available.
23841  */
23842 
23843 void
23845  SPI_MODULE_ID index ) ;
23846 //******************************************************************************
23847 /* Function:
23848  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
23849  uint32_t baudRate )
23850  Summary:
23851  Sets the baud rate to the desired value.
23852  Description:
23853  This function sets the baud rate to the desired value.
23854  Precondition:
23855  None.
23856  Parameters:
23857  index - Identifier for the device instance to be configured
23858  clockFrequency - Clock frequency
23859  baudrate - Baud rate value
23860  Returns:
23861  None.
23862  Example:
23863  <code>
23864  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23865  // application developer.
23866  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
23867  </code>
23868  Remarks:
23869  Setting a new baud rate value causes the baud rate timer to reset.
23870  This ensures that the baud rate timer does not have to overflow before
23871  outputting the new baud rate.
23872  If the system clock is changed during an active receive operation, a
23873  receive error or data loss may result. To avoid this issue, verify that
23874  no receptions are in progress before changing the system clock.
23875  This function implements an operation of the baud rate set feature.
23876  This feature may not be available on all devices. Please refer to the
23877  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
23878  in your application to automatically determine whether this feature is available.
23879  */
23880 
23881 void
23883  SPI_MODULE_ID index ,
23884  uint32_t clockFrequency ,
23885  uint32_t baudRate ) ;
23886 //******************************************************************************
23887 /* Function:
23888  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
23889  Summary:
23890  Returns the current SPI module activity status.
23891  Description:
23892  This function returns the current SPI module activity status.
23893  This operation is atomic.
23894  Precondition:
23895  None.
23896  Parameters:
23897  index - Identifier for the device instance to be configured
23898  Returns:
23899  - true - SPI module is currently busy with some transactions
23900  - false - SPI module is currently idle
23901  Example:
23902  <code>
23903  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23904  // application developer.
23905  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
23906  </code>
23907  Remarks:
23908  This function implements an operation of the bus status feature.
23909  This feature may not be available on all devices. Please refer to the
23910  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
23911  in your application to automatically determine whether this feature is available.
23912  */
23913 
23914 bool
23915  PLIB_SPI_IsBusy (
23916  SPI_MODULE_ID index ) ;
23917 //******************************************************************************
23918 /* Function:
23919  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
23920  Summary:
23921  Returns the current status of the receive (RX) FIFO sign-extended data.
23922  Description:
23923  This function returns the current status of the receive (RX) FIFO
23924  sign-extended data.
23925  This operation is atomic.
23926  Precondition:
23927  None.
23928  Parameters:
23929  index - Identifier for the device instance to be configured
23930  Returns:
23931  - true - Data from RX FIFO is sign-extended
23932  - false - Data from RX FIFO is not sign-extended
23933  Example:
23934  <code>
23935  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23936  // application developer.
23937  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
23938  </code>
23939  Remarks:
23940  This function implements an operation of the data sign feature.
23941  This feature may not be available on all devices. Please refer to the
23942  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
23943  in your application to automatically determine whether this feature is available.
23944  */
23945 
23946 bool
23948  SPI_MODULE_ID index ) ;
23949 //******************************************************************************
23950 /* Function:
23951  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
23952  Summary:
23953  Enables Master mode slave select.
23954  Description:
23955  This function enables Master mode slave select.
23956  This operation is atomic.
23957  Precondition:
23958  None.
23959  Parameters:
23960  index - Identifier for the device instance to be configured
23961  Returns:
23962  None.
23963  Example:
23964  <code>
23965  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23966  // application developer.
23967  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
23968  </code>
23969  Remarks:
23970  This feature does not support Framed SPI mode.
23971  This function implements an operation of the Master mode slave select feature.
23972  This feature may not be available on all devices. Please refer to the
23973  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
23974  in your application to automatically determine whether this feature is available.
23975 
23976  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
23977  */
23978 
23979 void
23981  SPI_MODULE_ID index ) ;
23982 //******************************************************************************
23983 /* Function:
23984  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
23985  Summary:
23986  Disables Master mode slave select.
23987  Description:
23988  This function disables Master mode slave select.
23989  This operation is atomic.
23990  Precondition:
23991  None.
23992  Parameters:
23993  index - Identifier for the device instance to be configured
23994  Returns:
23995  None.
23996  Example:
23997  <code>
23998  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23999  // application developer.
24000  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
24001  </code>
24002  Remarks:
24003  This feature does not support Framed SPI mode.
24004  This function implements an operation of the slave select feature.
24005  This feature may not be available on all devices. Please refer to the
24006  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24007  in your application to automatically determine whether this feature is available.
24008 
24009  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24010  */
24011 
24012 void
24014  SPI_MODULE_ID index ) ;
24015 //******************************************************************************
24016 /* Function:
24017  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24018  Summary:
24019  Returns the current status of the transmit underrun.
24020  Description:
24021  This function returns the current status of the transmit underrun.
24022  This operation is atomic.
24023  Precondition:
24024  None.
24025  Parameters:
24026  index - Identifier for the device instance to be configured
24027  Returns:
24028  - true - Transmit buffer has encountered an underrun condition
24029  - false - Transmit buffer run has not encountered an underrun condition
24030  Example:
24031  <code>
24032  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24033  // application developer.
24034  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24035  </code>
24036  Remarks:
24037  Valid in Framed Sync mode.
24038  This function implements an operation of the transmit underrun status feature.
24039  This feature may not be available on all devices. Please refer to the
24040  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24041  in your application to automatically determine whether this feature is available.
24042  */
24043 
24044 bool
24046  SPI_MODULE_ID index ) ;
24047 //******************************************************************************
24048 /* Function:
24049  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24050  Summary:
24051  Clears the SPI transmit underrun flag.
24052  Description:
24053  This function clears the SPI transmit underrun flag.
24054  This operation is atomic.
24055  Precondition:
24056  None.
24057  Parameters:
24058  index - Identifier for the device instance to be configured
24059  Returns:
24060  None.
24061  Example:
24062  <code>
24063  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24064  // application developer.
24065  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24066  </code>
24067  Remarks:
24068  This function implements an operation of the transmit underrun status feature.
24069  This feature may not be available on all devices. Please refer to the
24070  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24071  in your application to automatically determine whether this feature is available.
24072  */
24073 
24074 void
24076  SPI_MODULE_ID index ) ;
24077 //******************************************************************************
24078 /* Function:
24079  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24080  Summary:
24081  Returns the current status of the transmit buffer.
24082  Description:
24083  This function returns the current status of the transmit buffer.
24084  This operation is atomic.
24085  Precondition:
24086  None.
24087  Parameters:
24088  index - Identifier for the device instance to be configured
24089  Returns:
24090  - true - Transmit buffer is empty
24091  - false - Transmit buffer is not empty
24092  Example:
24093  <code>
24094  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24095  // application developer.
24096  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24097  </code>
24098  Remarks:
24099  This function implements an operation of the transmit buffer empty status feature.
24100  This feature may not be available on all devices. Please refer to the
24101  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24102  in your application to automatically determine whether this feature is available.
24103  */
24104 
24105 bool
24107  SPI_MODULE_ID index ) ;
24108 //******************************************************************************
24109 /* Function:
24110  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24111  Summary:
24112  Enables the SPI enhanced buffer.
24113  Description:
24114  This function enables the SPI enhanced buffer.
24115  This operation is atomic.
24116  Precondition:
24117  None.
24118  Parameters:
24119  index - Identifier for the device instance to be configured
24120  Returns:
24121  None.
24122  Example:
24123  <code>
24124  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24125  // application developer.
24126  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24127  </code>
24128  Remarks:
24129  This enables the enhanced buffer mode.
24130  This function implements an operation of the FIFO control feature.
24131  This feature may not be available on all devices. Please refer to the
24132  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24133  in your application to automatically determine whether this feature is available.
24134  */
24135 
24136 void
24138  SPI_MODULE_ID index ) ;
24139 //******************************************************************************
24140 /* Function:
24141  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24142  Summary:
24143  Disables the SPI enhanced buffer.
24144  Description:
24145  This function disables the SPI enhanced buffer.
24146  This operation is atomic.
24147  Precondition:
24148  None.
24149  Parameters:
24150  index - Identifier for the device instance to be configured
24151  Returns:
24152  None.
24153  Example:
24154  <code>
24155  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24156  // application developer.
24157  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24158  </code>
24159  Remarks:
24160  Enables the legacy standard single buffer mode.
24161  This function implements an operation of the FIFO control feature.
24162  This feature may not be available on all devices. Please refer to the
24163  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24164  in your application to automatically determine whether this feature is available.
24165  */
24166 
24167 void
24169  SPI_MODULE_ID index ) ;
24170 //******************************************************************************
24171 /* Function:
24172  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24173  Summary:
24174  Reads the SPI Buffer Element Count bits for either receive or transmit.
24175  Description:
24176  This function reads the number of SPI transfers pending for Master mode
24177  and the number of unread SPI transfers for Slave mode.
24178  Precondition:
24179  None.
24180  Parameters:
24181  index - Identifier for the device instance to be configured
24182  type - One of the SPI_FIFO_TYPE enumeration values
24183  Returns:
24184  CountValue - Buffer element count bits
24185  Example:
24186  <code>
24187  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24188  // application developer.
24189  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24190  </code>
24191  Remarks:
24192  Valid in Enhanced Buffer mode.
24193  This function implements an operation of the FIFO control feature.
24194  This feature may not be available on all devices. Please refer to the
24195  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24196  in your application to automatically determine whether this feature is available.
24197  */
24198 
24199 uint8_t
24201  SPI_MODULE_ID index ,
24202  SPI_FIFO_TYPE type ) ;
24203 //******************************************************************************
24204 /* Function:
24205  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24206  Summary:
24207  Returns the current status of the SPI shift register.
24208  Description:
24209  This function returns the current status of the SPI shift register.
24210  This operation is atomic.
24211  Precondition:
24212  None.
24213  Parameters:
24214  index - Identifier for the device instance to be configured
24215  Returns:
24216  - true - SPI shift register is empty and ready to send or receive
24217  - false - SPI shift register is not empty
24218  Example:
24219  <code>
24220  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24221  // application developer.
24222  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24223  </code>
24224  Remarks:
24225  Valid in Enhanced Buffer mode.
24226  This function implements an operation of the FIFO status feature.
24227  This feature may not be available on all devices. Please refer to the
24228  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24229  in your application to automatically determine whether this feature is available.
24230  */
24231 
24232 bool
24234  SPI_MODULE_ID index ) ;
24235 //******************************************************************************
24236 /* Function:
24237  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24238  Summary:
24239  Returns the current status of the SPI receive FIFO.
24240  Description:
24241  This function returns the current status of the SPI receive FIFO.
24242  This operation is atomic.
24243  Precondition:
24244  None.
24245  Parameters:
24246  index - Identifier for the device instance to be configured
24247  Returns:
24248  - true - Receive FIFO is empty
24249  - false - Receive FIFO is not empty
24250  Example:
24251  <code>
24252  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24253  // application developer.
24254  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24255  </code>
24256  Remarks:
24257  Valid in Enhanced Buffer mode.
24258  This function implements an operation of the FIFO status feature.
24259  This feature may not be available on all devices. Please refer to the
24260  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24261  in your application to automatically determine whether this feature is available.
24262  */
24263 
24264 bool
24266  SPI_MODULE_ID index ) ;
24267 //******************************************************************************
24268 /* Function:
24269  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24270  SPI_FIFO_INTERRUPT mode)
24271  Summary:
24272  Selects the SPI buffer interrupt mode.
24273  Description:
24274  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24275  Precondition:
24276  None.
24277  Parameters:
24278  index - Identifier for the device instance to be configured
24279  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24280  interrupt mode
24281  Returns:
24282  None.
24283  Example:
24284  <code>
24285  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24286  // application developer.
24287  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24288  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24289  </code>
24290  Remarks:
24291  Valid in Enhanced Buffer mode.
24292  This function implements an operation of the FIFO interrupt feature.
24293  This feature may not be available on all devices. Please refer to the
24294  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24295  in your application to automatically determine whether this feature is available.
24296  */
24297 
24298 void
24300  SPI_MODULE_ID index ,
24301  SPI_FIFO_INTERRUPT mode ) ;
24302 //******************************************************************************
24303 /* Function:
24304  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24305  Summary:
24306  Enables framed SPI support.
24307  Description:
24308  This function enables framed SPI support.
24309  This operation is atomic.
24310  Precondition:
24311  None.
24312  Parameters:
24313  index - Identifier for the device instance to be configured
24314  Returns:
24315  None.
24316  Example:
24317  <code>
24318  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24319  // application developer.
24320  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24321  </code>
24322  Remarks:
24323  This function implements an operation of the framed communication feature.
24324  This feature may not be available on all devices. Please refer to the
24325  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24326  in your application to automatically determine whether this feature is available.
24327  */
24328 
24329 void
24331  SPI_MODULE_ID index ) ;
24332 //******************************************************************************
24333 /* Function:
24334  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24335  Summary:
24336  Disables framed SPI support.
24337  Description:
24338  This function disables framed SPI support.
24339  This operation is atomic.
24340  Precondition:
24341  None.
24342  Parameters:
24343  index - Identifier for the device instance to be configured
24344  Returns:
24345  None.
24346  Example:
24347  <code>
24348  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24349  // application developer.
24350  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24351  </code>
24352  Remarks:
24353  This function implements an operation of the framed communication feature.
24354  This feature may not be available on all devices. Please refer to the
24355  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24356  in your application to automatically determine whether this feature is available.
24357  */
24358 
24359 void
24361  SPI_MODULE_ID index ) ;
24362 //******************************************************************************
24363 /* Function:
24364  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24365  SPI_FRAME_PULSE_DIRECTION direction)
24366  Summary:
24367  Selects the frame sync pulse direction.
24368  Description:
24369  This function selects the frame sync pulse direction.
24370  Precondition:
24371  None.
24372  Parameters:
24373  index - Identifier for the device instance to be configured
24374  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24375  as the SPI frame sync pulse polarity
24376  Returns:
24377  None.
24378  Example:
24379  <code>
24380  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24381  // application developer.
24382  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24383  </code>
24384  Remarks:
24385  This function implements an operation of the framed communication feature.
24386  This feature may not be available on all devices. Please refer to the
24387  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24388  in your application to automatically determine whether this feature is available.
24389  */
24390 
24391 void
24393  SPI_MODULE_ID index ,
24394  SPI_FRAME_PULSE_DIRECTION direction ) ;
24395 //******************************************************************************
24396 /* Function:
24397  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24398  SPI_FRAME_PULSE_POLARITY polarity)
24399  Summary:
24400  Selects the frame sync pulse polarity.
24401  Description:
24402  This function selects the frame sync pulse polarity.
24403  Precondition:
24404  None.
24405  Parameters:
24406  index - Identifier for the device instance to be configured
24407  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24408  sync pulse polarity
24409  Returns:
24410  None.
24411  Example:
24412  <code>
24413  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24414  // application developer.
24415  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24416  </code>
24417  Remarks:
24418  Available only for Frame mode.
24419  This function implements an operation of the framed communication feature.
24420  This feature may not be available on all devices. Please refer to the
24421  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24422  in your application to automatically determine whether this feature is available.
24423  */
24424 
24425 void
24427  SPI_MODULE_ID index ,
24428  SPI_FRAME_PULSE_POLARITY polarity ) ;
24429 //******************************************************************************
24430 /* Function:
24431  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24432  SPI_FRAME_PULSE_EDGE edge)
24433  Summary:
24434  Selects the frame sync pulse edge.
24435  Description:
24436  This function selects the frame sync pulse edge.
24437  Precondition:
24438  None.
24439  Parameters:
24440  index - Identifier for the device instance to be configured
24441  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24442  SPI frame sync pulse edge
24443  Returns:
24444  None.
24445  Example:
24446  <code>
24447  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24448  // application developer.
24449  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24450  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24451  </code>
24452  Remarks:
24453  This function implements an operation of the framed communication feature.
24454  This feature may not be available on all devices. Please refer to the
24455  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24456  in your application to automatically determine whether this feature is available.
24457  */
24458 
24459 void
24461  SPI_MODULE_ID index ,
24462  SPI_FRAME_PULSE_EDGE edge ) ;
24463 //******************************************************************************
24464 /* Function:
24465  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24466  SPI_FRAME_PULSE_WIDTH width)
24467  Summary:
24468  Sets the frame sync pulse width.
24469  Description:
24470  This function sets the frame sync pulse width.
24471  Precondition:
24472  None.
24473  Parameters:
24474  index - Identifier for the device instance to be configured
24475  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24476  frame sync pulse width.
24477  Returns:
24478  None.
24479  Example:
24480  <code>
24481  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24482  // application developer.
24483  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24484  </code>
24485  Remarks:
24486  Length of the word is dependent on the communication mode.
24487  This function implements an operation of the framed communication feature.
24488  This feature may not be available on all devices. Please refer to the
24489  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24490  in your application to automatically determine whether this feature is available.
24491  */
24492 
24493 void
24495  SPI_MODULE_ID index ,
24496  SPI_FRAME_PULSE_WIDTH width ) ;
24497 //******************************************************************************
24498 /* Function:
24499  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24500  SPI_FRAME_SYNC_PULSE pulse)
24501  Summary:
24502  Selects at which character the SPI frame sync pulse is generated.
24503  Description:
24504  This function selects at which character the SPI frame sync pulse is generated.
24505  Precondition:
24506  None.
24507  Parameters:
24508  index - Identifier for the device instance to be configured
24509  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24510  frame sync pulse count
24511  Returns:
24512  None.
24513  Example:
24514  <code>
24515  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24516  // application developer.
24517  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24518  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24519  </code>
24520  Remarks:
24521  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24522  This function implements an operation of the framed communication feature.
24523  This feature may not be available on all devices. Please refer to the
24524  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24525  in your application to automatically determine whether this feature is available.
24526  */
24527 
24528 void
24530  SPI_MODULE_ID index ,
24531  SPI_FRAME_SYNC_PULSE pulse ) ;
24532 //******************************************************************************
24533 /* Function:
24534  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24535  Summary:
24536  Returns the current status of the SPI frame error.
24537  Description:
24538  This function returns the current status of the SPI frame error.
24539  This operation is atomic.
24540  Precondition:
24541  None.
24542  Parameters:
24543  index - Identifier for the device instance to be configured
24544  Returns:
24545  - true - Frame error detected
24546  - false - No frame error detected
24547  Example:
24548  <code>
24549  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24550  // application developer.
24551  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
24552  </code>
24553  Remarks:
24554  Valid only if Frame mode is enabled.
24555  This function implements an operation of the framed communication feature.
24556  This feature may not be available on all devices. Please refer to the
24557  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
24558  in your application to automatically determine whether this feature is available.
24559  */
24560 
24561 bool
24563  SPI_MODULE_ID index ) ;
24564 //******************************************************************************
24565 /* Function:
24566  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
24567  Summary:
24568  Clears the SPI frame error flag.
24569  Description:
24570  This function clears the SPI frame error flag.
24571  This operation is atomic.
24572  Precondition:
24573  None.
24574  Parameters:
24575  index - Identifier for the device instance to be configured
24576  Returns:
24577  None.
24578  Example:
24579  <code>
24580  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24581  // application developer.
24582  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
24583  </code>
24584  Remarks:
24585  This function implements an operation of the frame error status feature.
24586  This feature may not be available on all devices. Please refer to the
24587  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
24588  in your application to automatically determine whether this feature is available.
24589  */
24590 
24591 void
24593  SPI_MODULE_ID index ) ;
24594 //******************************************************************************
24595 /* Function:
24596  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
24597  Summary:
24598  Clears the SPI receive buffer.
24599  Description:
24600  This function clears the SPI receive buffer.
24601  In Enhanced Buffer mode, this functions clears the full RX FIFO.
24602  This operation is atomic.
24603  Precondition:
24604  None.
24605  Parameters:
24606  index - Identifier for the device instance to be configured
24607  Returns:
24608  None.
24609  Example:
24610  <code>
24611  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24612  // application developer.
24613  //This call will flush the receive buffer.
24614  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
24615  </code>
24616  Remarks:
24617  This function implements an operation of the buffer control feature.
24618  This feature may not be available on all devices. Please refer to the
24619  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24620  in your application to automatically determine whether this feature is available.
24621  */
24622 
24623 void
24625  SPI_MODULE_ID index ) ;
24626 //******************************************************************************
24627 /* Function:
24628  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
24629  Summary:
24630  Returns the SPI buffer value.
24631  Description:
24632  This function returns the SPI buffer value.
24633  This operation is atomic.
24634  Precondition:
24635  None.
24636  Parameters:
24637  index - Identifier for the device instance to be configured
24638  Returns:
24639  Reads the SPI buffer.
24640  Example:
24641  <code>
24642  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24643  // application developer.
24644  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
24645  </code>
24646  Remarks:
24647  This function implements an operation of the buffer control feature.
24648  This feature may not be available on all devices. Please refer to the
24649  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24650  in your application to automatically determine whether this feature is available.
24651  */
24652 
24653 uint8_t
24655  SPI_MODULE_ID index ) ;
24656 //******************************************************************************
24657 /* Function:
24658  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
24659  Summary:
24660  Returns 16-bit SPI buffer value.
24661  Description:
24662  This function returns 16-bit SPI buffer value.
24663  This operation is atomic.
24664  Precondition:
24665  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24666  Parameters:
24667  index - Identifier for the device instance to be configured
24668  Returns:
24669  Returns the SPI 16-bit buffer value.
24670  Example:
24671  <code>
24672 #define MY_SPI_INSTANCE SPI_ID_1
24673 
24674  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
24675  </code>
24676  Remarks:
24677  This function implements an operation of the buffer control feature.
24678  This feature may not be available on all devices. Please refer to the
24679  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24680  in your application to automatically determine whether this feature is available.
24681  */
24682 
24683 uint16_t
24685  SPI_MODULE_ID index ) ;
24686 //******************************************************************************
24687 /* Function:
24688  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
24689  Summary:
24690  Returns 32-bit SPI buffer value.
24691  Description:
24692  This function returns 32-bit SPI buffer value.
24693  This operation is atomic.
24694  Precondition:
24695  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24696  Parameters:
24697  index - Identifier for the device instance to be configured
24698  Returns:
24699  Returns the SPI 32-bit buffer value.
24700  Example:
24701  <code>
24702 #define MY_SPI_INSTANCE SPI_ID_1
24703 
24704  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
24705  </code>
24706  Remarks:
24707  This function implements an operation of the buffer control feature.
24708  This feature may not be available on all devices. Please refer to the
24709  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24710  in your application to automatically determine whether this feature is available.
24711  */
24712 
24713 uint32_t
24715  SPI_MODULE_ID index ) ;
24716 //******************************************************************************
24717 /* Function:
24718  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
24719  Summary:
24720  Write the data to the SPI buffer.
24721  Description:
24722  This function writes data to the SPI buffer.
24723  This operation is atomic.
24724  Precondition:
24725  None.
24726  Parameters:
24727  index - Identifier for the device instance to be configured
24728  data - Data to written to the SPI buffer
24729  Returns:
24730  None.
24731  Example:
24732  <code>
24733  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24734  // application developer.
24735  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
24736  </code>
24737  Remarks:
24738  This function implements an operation of the buffer control feature.
24739  This feature may not be available on all devices. Please refer to the
24740  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24741  in your application to automatically determine whether this feature is available.
24742  */
24743 
24744 void
24746  SPI_MODULE_ID index ,
24747  uint8_t data ) ;
24748 //******************************************************************************
24749 /* Function:
24750  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
24751  Summary:
24752  Writes 16-bit data to the SPI buffer.
24753  Description:
24754  This function writes 16-bit data to the SPI buffer.
24755  This operation is atomic.
24756  Precondition:
24757  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24758  Parameters:
24759  index - Identifier for the device instance to be configured
24760  data - 16-bit data to be written to the SPI buffer
24761  Returns:
24762  None.
24763  Example:
24764  <code>
24765 #define MY_SPI_INSTANCE SPI_ID_1
24766 
24767  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
24768  </code>
24769  Remarks:
24770  This function implements an operation of the buffer control feature.
24771  This feature may not be available on all devices. Please refer to the
24772  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24773  in your application to automatically determine whether this feature is available.
24774  */
24775 
24776 void
24778  SPI_MODULE_ID index ,
24779  uint16_t data ) ;
24780 //******************************************************************************
24781 /* Function:
24782  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
24783  Summary:
24784  Write 32-bit data to the SPI buffer.
24785  Description:
24786  This function writes 32-bit data to the SPI buffer.
24787  This operation is atomic.
24788  Precondition:
24789  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24790  Parameters:
24791  index - Identifier for the device instance to be configured
24792  data - 32-bit data to be written to the SPI buffer
24793  Returns:
24794  None.
24795  Example:
24796  <code>
24797 #define MY_SPI_INSTANCE SPI_ID_1
24798 
24799  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
24800  </code>
24801  Remarks:
24802  This function implements an operation of the buffer control feature.
24803  This feature may not be available on all devices. Please refer to the
24804  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24805  in your application to automatically determine whether this feature is available.
24806  */
24807 
24808 void
24810  SPI_MODULE_ID index ,
24811  uint32_t data ) ;
24812 //******************************************************************************
24813 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
24814  Summary:
24815  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
24816  register.
24817  Description:
24818  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
24819  (SPIxRXB)) register.
24820  This operation is atomic.
24821  Preconditions:
24822  None.
24823  Parameters:
24824  index - Identifier for the device instance
24825  Returns:
24826  The address of the SPIxBUF register
24827  Remarks:
24828  None.
24829 */
24830 
24831 void *
24833  SPI_MODULE_ID index ) ;
24834 //******************************************************************************
24835 /* Function:
24836  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
24837  SPI_BAUD_RATE_CLOCK type)
24838  Summary:
24839  Selects the type of clock is used by the Baud Rate Generator.
24840  Description:
24841  This function selects the type of clock is used by the Baud Rate Generator.
24842  Precondition:
24843  None.
24844  Parameters:
24845  index - Identifier for the device instance to be configured
24846  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
24847  Returns:
24848  None.
24849  Example:
24850  <code>
24851  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24852  // application developer.
24853  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
24854  </code>
24855  Remarks:
24856  This function implements an operation of the baud rate clock control feature.
24857  This feature may not be available on all devices. Please refer to the
24858  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
24859  in your application to automatically determine whether this feature is available.
24860  */
24861 
24862 void
24864  SPI_MODULE_ID index ,
24865  SPI_BAUD_RATE_CLOCK type ) ;
24866 //******************************************************************************
24867 /* Function:
24868  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
24869  SPI_ERROR_INTERRUPT error)
24870  Summary:
24871  Enables SPI error interrupts
24872  Description:
24873  This function enables SPI error interrupts.
24874  Precondition:
24875  None.
24876  Parameters:
24877  index - Identifier for the device instance to be configured
24878  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
24879  SPI interrupt error
24880  Returns:
24881  None.
24882  Example:
24883  <code>
24884  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24885  // application developer.
24886  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24887  </code>
24888  Remarks:
24889  This function implements an operation of the error interrupt control feature.
24890  This feature may not be available on all devices. Please refer to the
24891  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24892  in your application to automatically determine whether this feature is available.
24893  */
24894 
24895 void
24897  SPI_MODULE_ID index ,
24898  SPI_ERROR_INTERRUPT error ) ;
24899 //******************************************************************************
24900 /* Function:
24901  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
24902  SPI_ERROR_INTERRUPT error)
24903  Summary:
24904  Enables SPI error interrupts.
24905  Description:
24906  This function enables SPI error interrupts.
24907  Precondition:
24908  None.
24909  Parameters:
24910  index - Identifier for the device instance to be configured
24911  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
24912  SPI interrupt error
24913  Returns:
24914  None.
24915  Example:
24916  <code>
24917  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24918  // application developer.
24919  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24920  </code>
24921  Remarks:
24922  This function implements an operation of the error interrupt control feature.
24923  This feature may not be available on all devices. Please refer to the
24924  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24925  in your application to automatically determine whether this feature is available.
24926  */
24927 
24928 void
24930  SPI_MODULE_ID index ,
24931  SPI_ERROR_INTERRUPT error ) ;
24932 //******************************************************************************
24933 /* Function:
24934  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
24935  Summary:
24936  Enables the SPI error.
24937  Description:
24938  This function enables the SPI error.
24939  This operation is atomic.
24940  Precondition:
24941  None.
24942  Parameters:
24943  index - Identifier for the device instance to be configured
24944  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24945  Returns:
24946  None.
24947  Example:
24948  <code>
24949  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24950  // application developer.
24951  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24952  </code>
24953  Remarks:
24954  This function implements an operation of the audio error control feature.
24955  This feature may not be available on all devices. Please refer to the
24956  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24957  in your application to automatically determine whether this feature is available.
24958  */
24959 
24960 void
24962  SPI_MODULE_ID index ,
24963  SPI_AUDIO_ERROR error ) ;
24964 //******************************************************************************
24965 /* Function:
24966  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
24967  Summary:
24968  Disables the SPI error.
24969  Description:
24970  This function disables the SPI error.
24971  This operation is atomic.
24972  Precondition:
24973  None.
24974  Parameters:
24975  index - Identifier for the device instance to be configured
24976  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24977  Returns:
24978  None.
24979  Example:
24980  <code>
24981  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24982  // application developer.
24983  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24984  </code>
24985  Remarks:
24986  This function implements an operation of the audio error control feature.
24987  This feature may not be available on all devices. Please refer to the
24988  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24989  in your application to automatically determine whether this feature is available.
24990  */
24991 
24992 void
24994  SPI_MODULE_ID index ,
24995  SPI_AUDIO_ERROR error ) ;
24996 //******************************************************************************
24997 /* Function:
24998  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
24999  Summary:
25000  Audio protocol is enabled.
25001  Description:
25002  This function enables the audio protocol.
25003  This operation is atomic.
25004  Precondition:
25005  Disable the SPI module by calling PLIB_SPI_Disable.
25006  Parameters:
25007  index - Identifier for the device instance to be configured
25008  Returns:
25009  None.
25010  Example:
25011  <code>
25012  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25013  // application developer.
25014  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25015  </code>
25016  Remarks:
25017  This function implements an operation of the audio protocol control feature.
25018  This feature may not be available on all devices. Please refer to the
25019  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25020  in your application to automatically determine whether this feature is available.
25021  */
25022 
25023 void
25025  SPI_MODULE_ID index ) ;
25026 //******************************************************************************
25027 /* Function:
25028  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25029  Summary:
25030  Audio protocol is disabled.
25031  Description:
25032  This function disables the audio protocol.
25033  This operation is atomic.
25034  Precondition:
25035  None.
25036  Parameters:
25037  index - Identifier for the device instance to be configured
25038  Returns:
25039  None.
25040  Example:
25041  <code>
25042  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25043  // application developer.
25044  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25045  </code>
25046  Remarks:
25047  This function implements an operation of the audio protocol control feature.
25048  This feature may not be available on all devices. Please refer to the
25049  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25050  in your application to automatically determine whether this feature is available.
25051  */
25052 
25053 void
25055  SPI_MODULE_ID index ) ;
25056 //******************************************************************************
25057 /* Function:
25058  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25059  SPI_AUDIO_TRANSMIT_MODE mode)
25060  Summary:
25061  Selects the transmit audio data format.
25062  Description:
25063  This function selects the transmit audio data format.
25064  Precondition:
25065  None.
25066  Parameters:
25067  index - Identifier for the device instance to be configured
25068  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25069  transmit audio format
25070  Returns:
25071  None.
25072  Example:
25073  <code>
25074  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25075  // application developer.
25076  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25077  </code>
25078  Remarks:
25079  This function implements an operation of the audio transmit mode feature.
25080  This feature may not be available on all devices. Please refer to the
25081  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25082  in your application to automatically determine whether this feature is available.
25083  */
25084 
25085 void
25087  SPI_MODULE_ID index ,
25088  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25089 //******************************************************************************
25090 /* Function:
25091  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25092  SPI_AUDIO_PROTOCOL mode )
25093  Summary:
25094  Selects the Audio Protocol mode.
25095  Description:
25096  This function selects the Audio Protocol mode.
25097  Precondition:
25098  None.
25099  Parameters:
25100  index - Identifier for the device instance to be configured
25101  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25102  audio protocol
25103  Returns:
25104  None.
25105  Example:
25106  <code>
25107  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25108  // application developer.
25109  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25110  </code>
25111  Remarks:
25112  This function implements an operation of the audio protocol mode feature.
25113  This feature may not be available on all devices. Please refer to the
25114  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25115  in your application to automatically determine whether this feature is available.
25116  */
25117 
25118 void
25120  SPI_MODULE_ID index ,
25121  SPI_AUDIO_PROTOCOL mode ) ;
25122 // *****************************************************************************
25123 // *****************************************************************************
25124 // Section: SPI Peripheral Library Exists Functions
25125 // *****************************************************************************
25126 // *****************************************************************************
25127 /* The following functions indicate the existence of the features on the device.
25128 */
25129 //******************************************************************************
25130 /* Function:
25131  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25132  Summary:
25133  Identifies whether the EnableControl feature exists on the SPI module.
25134  Description:
25135  This function identifies whether the EnableControl feature is available on
25136  the SPI module.
25137  When this function returns true, these functions are supported on the device:
25138  - PLIB_SPI_Enable
25139  - PLIB_SPI_Disable
25140  This operation is atomic.
25141  Preconditions:
25142  None.
25143  Parameters:
25144  index - Identifier for the device instance
25145  Returns:
25146  - true - The EnableControl feature is supported on the device
25147  - false - The EnableControl feature is not supported on the device
25148  Remarks:
25149  None.
25150 */
25151 
25152 bool
25154  SPI_MODULE_ID index ) ;
25155 //******************************************************************************
25156 /* Function:
25157  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25158  Summary:
25159  Identifies whether the StopInIdle feature exists on the SPI module.
25160  Description:
25161  This function identifies whether the StopInIdle feature is available on the
25162  SPI module.
25163  When this function returns true, these functions are supported on the device:
25164  - PLIB_SPI_StopInIdleEnable
25165  - PLIB_SPI_StopInIdleDisable
25166  This operation is atomic.
25167  Preconditions:
25168  None.
25169  Parameters:
25170  index - Identifier for the device instance
25171  Returns:
25172  - true - The StopInIdle feature is supported on the device
25173  - false - The StopInIdle feature is not supported on the device
25174  Remarks:
25175  None.
25176 */
25177 
25178 bool
25180  SPI_MODULE_ID index ) ;
25181 //******************************************************************************
25182 /* Function:
25183  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25184  Summary:
25185  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25186  Description:
25187  This function identifies whether the ReceiverOverflow feature is available
25188  on the SPI module.
25189  When this function returns true, these functions are supported on the device:
25190  - PLIB_SPI_ReceiverHasOverflowed
25191  - PLIB_SPI_ReceiverOverflowClear
25192  This operation is atomic.
25193  Preconditions:
25194  None.
25195  Parameters:
25196  index - Identifier for the device instance
25197  Returns:
25198  - true - The ReceiverOverflow feature is supported on the device
25199  - false - The ReceiverOverflow feature is not supported on the device
25200  Remarks:
25201  None.
25202 */
25203 
25204 bool
25206  SPI_MODULE_ID index ) ;
25207 //******************************************************************************
25208 /* Function:
25209  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25210  Summary:
25211  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25212  Description:
25213  This function identifies whether the TransmitBufferFullStatus feature is available
25214  on the SPI module.
25215  When this function returns true, this function is supported on the device:
25216  - PLIB_SPI_TransmitBufferIsFull
25217  This operation is atomic.
25218  Preconditions:
25219  None.
25220  Parameters:
25221  index - Identifier for the device instance
25222  Returns:
25223  - true - The TransmitBufferFullStatus feature is supported on the device
25224  - false - The TransmitBufferFullStatus feature is not supported on the device
25225  Remarks:
25226  None.
25227 */
25228 
25229 bool
25231  SPI_MODULE_ID index ) ;
25232 //******************************************************************************
25233 /* Function:
25234  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25235  Summary:
25236  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25237  Description:
25238  This function identifies whether the TransmitBufferEmptyStatus feature is available
25239  on the SPI module.
25240  When this function returns true, this function is supported on the device:
25241  - PLIB_SPI_TransmitBufferIsEmpty
25242  This operation is atomic.
25243  Preconditions:
25244  None.
25245  Parameters:
25246  index - Identifier for the device instance
25247  Returns:
25248  - true - The TransmitBufferEmptyStatus feature is supported on the device
25249  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25250  Remarks:
25251  None.
25252 */
25253 
25254 bool
25256  SPI_MODULE_ID index ) ;
25257 //******************************************************************************
25258 /* Function:
25259  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25260  Summary:
25261  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25262  Description:
25263  This function identifies whether the ReceiveBufferStatus feature is available
25264  on the SPI module.
25265  When this function returns true, this function is supported on the device:
25266  - PLIB_SPI_ReceiverBufferIsFull
25267  This operation is atomic.
25268  Preconditions:
25269  None.
25270  Parameters:
25271  index - Identifier for the device instance
25272  Returns:
25273  - true - The ReceiveBufferStatus feature is supported on the device
25274  - false - The ReceiveBufferStatus feature is not supported on the device
25275  Remarks:
25276  None.
25277 */
25278 
25279 bool
25281  SPI_MODULE_ID index ) ;
25282 //******************************************************************************
25283 /* Function:
25284  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25285  Summary:
25286  Identifies whether the PinControl feature exists on the SPI module.
25287  Description:
25288  This function identifies whether the PinControl feature is available on the
25289  SPI module.
25290  When this function returns true, these functions are supported on the device:
25291  - PLIB_SPI_PinEnable
25292  - PLIB_SPI_PinDisable
25293  This operation is atomic.
25294  Preconditions:
25295  None.
25296  Parameters:
25297  index - Identifier for the device instance
25298  Returns:
25299  - true - The PinControl feature is supported on the device
25300  - false - The PinControl feature is not supported on the device
25301  Remarks:
25302  None.
25303 */
25304 
25305 bool
25307  SPI_MODULE_ID index ) ;
25308 //******************************************************************************
25309 /* Function:
25310  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25311  Summary:
25312  Identifies whether the CommunicationWidth feature exists on the SPI module.
25313  Description:
25314  This function identifies whether the CommunicationWidth feature is available
25315  on the SPI module.
25316  When this function returns true, this function is supported on the device:
25317  - PLIB_SPI_CommunicationWidthSelect
25318  This operation is atomic.
25319  Preconditions:
25320  None.
25321  Parameters:
25322  index - Identifier for the device instance
25323  Returns:
25324  - true - The CommunicationWidth feature is supported on the device
25325  - false - The CommunicationWidth feature is not supported on the device
25326  Remarks:
25327  None.
25328 */
25329 
25330 bool
25332  SPI_MODULE_ID index ) ;
25333 //******************************************************************************
25334 /* Function:
25335  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25336  Summary:
25337  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25338  Description:
25339  This function identifies whether the AudioCommunicationWidth feature is available
25340  on the SPI module.
25341  When this function returns true, this function is supported on the device:
25342  - PLIB_SPI_AudioCommunicationWidthSelect
25343  This operation is atomic.
25344  Preconditions:
25345  None.
25346  Parameters:
25347  index - Identifier for the device instance
25348  Returns:
25349  - true - The AudioCommunicationWidth feature is supported on the device
25350  - false - The AudioCommunicationWidth feature is not supported on the device
25351  Remarks:
25352  None.
25353 */
25354 
25355 bool
25357  SPI_MODULE_ID index ) ;
25358 //******************************************************************************
25359 /* Function:
25360  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25361  Summary:
25362  Identifies whether the InputSamplePhase feature exists on the SPI module.
25363  Description:
25364  This function identifies whether the InputSamplePhase feature is available
25365  on the SPI module.
25366  When this function returns true, this function is supported on the device:
25367  - PLIB_SPI_InputSamplePhaseSelect
25368  This operation is atomic.
25369  Preconditions:
25370  None.
25371  Parameters:
25372  index - Identifier for the device instance
25373  Returns:
25374  - true - The InputSamplePhase feature is supported on the device
25375  - false - The InputSamplePhase feature is not supported on the device
25376  Remarks:
25377  None.
25378 */
25379 
25380 bool
25382  SPI_MODULE_ID index ) ;
25383 //******************************************************************************
25384 /* Function:
25385  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25386  Summary:
25387  Identifies whether the OutputDataPhase feature exists on the SPI module.
25388  Description:
25389  This function identifies whether the OutputDataPhase feature is available on
25390  the SPI module.
25391  When this function returns true, this function is supported on the device:
25392  - PLIB_SPI_OutputDataPhaseSelect
25393  This operation is atomic.
25394  Preconditions:
25395  None.
25396  Parameters:
25397  index - Identifier for the device instance
25398  Returns:
25399  - true - The OutputDataPhase feature is supported on the device
25400  - false - The OutputDataPhase feature is not supported on the device
25401  Remarks:
25402  None.
25403 */
25404 
25405 bool
25407  SPI_MODULE_ID index ) ;
25408 //******************************************************************************
25409 /* Function:
25410  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25411  Summary:
25412  Identifies whether the ClockPolarity feature exists on the SPI module.
25413  Description:
25414  This function identifies whether the ClockPolarity feature is available on
25415  the SPI module.
25416  When this function returns true, this function is supported on the device:
25417  - PLIB_SPI_ClockPolaritySelect
25418  This operation is atomic.
25419  Preconditions:
25420  None.
25421  Parameters:
25422  index - Identifier for the device instance
25423  Returns:
25424  - true - The ClockPolarity feature is supported on the device
25425  - false - The ClockPolarity feature is not supported on the device
25426  Remarks:
25427  None.
25428 */
25429 
25430 bool
25432  SPI_MODULE_ID index ) ;
25433 //******************************************************************************
25434 /* Function:
25435  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25436  Summary:
25437  Identifies whether the MasterControl feature exists on the SPI module.
25438  Description:
25439  This function identifies whether the MasterControl feature is available on
25440  the SPI module.
25441  When this function returns true, these functions are supported on the device:
25442  - PLIB_SPI_MasterEnable
25443  - PLIB_SPI_SlaveEnable
25444  This operation is atomic.
25445  Preconditions:
25446  None.
25447  Parameters:
25448  index - Identifier for the device instance
25449  Returns:
25450  - true - The MasterControl feature is supported on the device
25451  - false - The MasterControl feature is not supported on the device
25452  Remarks:
25453  None.
25454 */
25455 
25456 bool
25458  SPI_MODULE_ID index ) ;
25459 //******************************************************************************
25460 /* Function:
25461  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25462  Summary:
25463  Identifies whether the BaudRate feature exists on the SPI module.
25464  Description:
25465  This function identifies whether the BaudRate feature is available on the SPI
25466  module.
25467  When this function returns true, this function is supported on the device:
25468  - PLIB_SPI_BaudRateSet
25469  This operation is atomic.
25470  Preconditions:
25471  None.
25472  Parameters:
25473  index - Identifier for the device instance
25474  Returns:
25475  - true - The BaudRate feature is supported on the device
25476  - false - The BaudRate feature is not supported on the device
25477  Remarks:
25478  None.
25479 */
25480 
25481 bool
25483  SPI_MODULE_ID index ) ;
25484 //******************************************************************************
25485 /* Function:
25486  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25487  Summary:
25488  Identifies whether the BusStatus feature exists on the SPI module.
25489  Description:
25490  This function identifies whether the BusStatus feature is available on the
25491  SPI module.
25492  When this function returns true, this function is supported on the device:
25493  - PLIB_SPI_IsBusy
25494  This operation is atomic.
25495  Preconditions:
25496  None.
25497  Parameters:
25498  index - Identifier for the device instance
25499  Returns:
25500  - true - The BusStatus feature is supported on the device
25501  - false - The BusStatus feature is not supported on the device
25502  Remarks:
25503  None.
25504 */
25505 
25506 bool
25508  SPI_MODULE_ID index ) ;
25509 //******************************************************************************
25510 /* Function:
25511  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25512  Summary:
25513  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25514  Description:
25515  This function identifies whether the ReadDataSignStatus feature is available
25516  on the SPI module.
25517  When this function returns true, this function is supported on the device:
25518  - PLIB_SPI_ReadDataIsSignExtended
25519  This operation is atomic.
25520  Preconditions:
25521  None.
25522  Parameters:
25523  index - Identifier for the device instance
25524  Returns:
25525  - true - The ReadDataSignStatus feature is supported on the device
25526  - false - The ReadDataSignStatus feature is not supported on the device
25527  Remarks:
25528  None.
25529 */
25530 
25531 bool
25533  SPI_MODULE_ID index ) ;
25534 //******************************************************************************
25535 /* Function:
25536  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25537  Summary:
25538  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25539  Description:
25540  This function identifies whether the SlaveSelectControl feature is available
25541  on the SPI module.
25542  When this function returns true, these functions are supported on the device:
25543  - PLIB_SPI_SlaveSelectEnable
25544  - PLIB_SPI_SlaveSelectDisable
25545  This operation is atomic.
25546  Preconditions:
25547  None.
25548  Parameters:
25549  index - Identifier for the device instance
25550  Returns:
25551  - true - The SlaveSelectControl feature is supported on the device
25552  - false - The SlaveSelectControl feature is not supported on the device
25553  Remarks:
25554  None.
25555 */
25556 
25557 bool
25559  SPI_MODULE_ID index ) ;
25560 //******************************************************************************
25561 /* Function:
25562  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
25563  Summary:
25564  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
25565  Description:
25566  This function identifies whether the TransmitUnderRunStatus feature is available
25567  on the SPI module.
25568  When this function returns true, these functions are supported on the device:
25569  - PLIB_SPI_TransmitUnderRunStatusGet
25570  - PLIB_SPI_TransmitUnderRunStatusClear
25571  This operation is atomic.
25572  Preconditions:
25573  None.
25574  Parameters:
25575  index - Identifier for the device instance
25576  Returns:
25577  - true - The TransmitUnderRunStatus feature is supported on the device
25578  - false - The TransmitUnderRunStatus feature is not supported on the device
25579  Remarks:
25580  None.
25581 */
25582 
25583 bool
25585  SPI_MODULE_ID index ) ;
25586 //******************************************************************************
25587 /* Function:
25588  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
25589  Summary:
25590  Identifies whether the FIFOControl feature exists on the SPI module.
25591  Description:
25592  This function identifies whether the FIFOControl feature is available on the
25593  SPI module.
25594  When this function returns true, these functions are supported on the device:
25595  - PLIB_SPI_FIFOEnable
25596  - PLIB_SPI_FIFODisable
25597  This operation is atomic.
25598  Preconditions:
25599  None.
25600  Parameters:
25601  index - Identifier for the device instance
25602  Returns:
25603  - true - The FIFOControl feature is supported on the device
25604  - false - The FIFOControl feature is not supported on the device
25605  Remarks:
25606  None.
25607 */
25608 
25609 bool
25611  SPI_MODULE_ID index ) ;
25612 //******************************************************************************
25613 /* Function:
25614  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
25615  Summary:
25616  Identifies whether the FIFOCount feature exists on the SPI module.
25617  Description:
25618  This function identifies whether the FIFOCount feature is available on the SPI module.
25619  When this function returns true, this function is supported on the device:
25620  - PLIB_SPI_FIFOCountGet
25621  This operation is atomic.
25622  Preconditions:
25623  None.
25624  Parameters:
25625  index - Identifier for the device instance
25626  Returns:
25627  - true - The FIFOCount feature is supported on the device
25628  - false - The FIFOCount feature is not supported on the device
25629  Remarks:
25630  None.
25631 */
25632 
25633 bool
25635  SPI_MODULE_ID index ) ;
25636 //******************************************************************************
25637 /* Function:
25638  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
25639  Summary:
25640  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
25641  Description:
25642  This function identifies whether the ReceiveFIFOStatus feature is available
25643  on the SPI module.
25644  When this function returns true, this function is supported on the device:
25645  - PLIB_SPI_ReceiverFIFOIsEmpty
25646  This operation is atomic.
25647  Preconditions:
25648  None.
25649  Parameters:
25650  index - Identifier for the device instance
25651  Returns:
25652  - true - The ReceiveFIFOStatus feature is supported on the device
25653  - false - The ReceiveFIFOStatus feature is not supported on the device
25654  Remarks:
25655  None.
25656 */
25657 
25658 bool
25660  SPI_MODULE_ID index ) ;
25661 //******************************************************************************
25662 /* Function:
25663  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
25664  Summary:
25665  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
25666  Description:
25667  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
25668  available on the SPI module.
25669  When this function returns true, this function is supported on the device:
25670  - PLIB_SPI_FIFOShiftRegisterIsEmpty
25671  This operation is atomic.
25672  Preconditions:
25673  None.
25674  Parameters:
25675  index - Identifier for the device instance
25676  Returns:
25677  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
25678  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
25679  Remarks:
25680  None.
25681 */
25682 
25683 bool
25685  SPI_MODULE_ID index ) ;
25686 //******************************************************************************
25687 /* Function:
25688  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
25689  Summary:
25690  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
25691  Description:
25692  This function identifies whether the FIFOInterruptMode feature is available
25693  on the SPI module.
25694  When this function returns true, this function is supported on the device:
25695  - PLIB_SPI_FIFOInterruptModeSelect
25696  This operation is atomic.
25697  Preconditions:
25698  None.
25699  Parameters:
25700  index - Identifier for the device instance
25701  Returns:
25702  - true - The FIFOInterruptMode feature is supported on the device
25703  - false - The FIFOInterruptMode feature is not supported on the device
25704  Remarks:
25705  None.
25706 */
25707 
25708 bool
25710  SPI_MODULE_ID index ) ;
25711 //******************************************************************************
25712 /* Function:
25713  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
25714  Summary:
25715  Identifies whether the FramedCommunication feature exists on the SPI module.
25716  Description:
25717  This function identifies whether the FramedCommunication feature is available
25718  on the SPI module.
25719  When this function returns true, these functions are supported on the device:
25720  - PLIB_SPI_FramedCommunicationEnable
25721  - PLIB_SPI_FramedCommunicationDisable
25722  This operation is atomic.
25723  Preconditions:
25724  None.
25725  Parameters:
25726  index - Identifier for the device instance
25727  Returns:
25728  - true - The FramedCommunication feature is supported on the device
25729  - false - The FramedCommunication feature is not supported on the device
25730  Remarks:
25731  None.
25732 */
25733 
25734 bool
25736  SPI_MODULE_ID index ) ;
25737 //******************************************************************************
25738 /* Function:
25739  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
25740  Summary:
25741  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
25742  Description:
25743  This function identifies whether the FrameSyncPulseDirection feature is available
25744  on the SPI module.
25745  When this function returns true, this function is supported on the device:
25746  - PLIB_SPI_FrameSyncPulseDirectionSelect
25747  This operation is atomic.
25748  Preconditions:
25749  None.
25750  Parameters:
25751  index - Identifier for the device instance
25752  Returns:
25753  - true - The FrameSyncPulseDirection feature is supported on the device
25754  - false - The FrameSyncPulseDirection feature is not supported on the device
25755  Remarks:
25756  None.
25757 */
25758 
25759 bool
25761  SPI_MODULE_ID index ) ;
25762 //******************************************************************************
25763 /* Function:
25764  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
25765  Summary:
25766  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
25767  Description:
25768  This function identifies whether the FrameSyncPulsePolarity feature is available
25769  on the SPI module.
25770  When this function returns true, this function is supported on the device:
25771  - PLIB_SPI_FrameSyncPulsePolaritySelect
25772  This operation is atomic.
25773  Preconditions:
25774  None.
25775  Parameters:
25776  index - Identifier for the device instance
25777  Returns:
25778  - true - The FrameSyncPulsePolarity feature is supported on the device
25779  - false - The FrameSyncPulsePolarity feature is not supported on the device
25780  Remarks:
25781  None.
25782 */
25783 
25784 bool
25786  SPI_MODULE_ID index ) ;
25787 //******************************************************************************
25788 /* Function:
25789  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
25790  Summary:
25791  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
25792  Description:
25793  This function identifies whether the FrameSyncPulseEdge feature is available
25794  on the SPI module.
25795  When this function returns true, this function is supported on the device:
25796  - PLIB_SPI_FrameSyncPulseEdgeSelect
25797  This operation is atomic.
25798  Preconditions:
25799  None.
25800  Parameters:
25801  index - Identifier for the device instance
25802  Returns:
25803  - true - The FrameSyncPulseEdge feature is supported on the device
25804  - false - The FrameSyncPulseEdge feature is not supported on the device
25805  Remarks:
25806  None.
25807 */
25808 
25809 bool
25811  SPI_MODULE_ID index ) ;
25812 //******************************************************************************
25813 /* Function:
25814  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
25815  Summary:
25816  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
25817  Description:
25818  This function identifies whether the FrameSyncPulseWidth feature is available
25819  on the SPI module.
25820  When this function returns true, this function is supported on the device:
25821  - PLIB_SPI_FrameSyncPulseWidthSelect
25822  This operation is atomic.
25823  Preconditions:
25824  None.
25825  Parameters:
25826  index - Identifier for the device instance
25827  Returns:
25828  - true - The FrameSyncPulseWidth feature is supported on the device
25829  - false - The FrameSyncPulseWidth feature is not supported on the device
25830  Remarks:
25831  None.
25832 */
25833 
25834 bool
25836  SPI_MODULE_ID index ) ;
25837 //******************************************************************************
25838 /* Function:
25839  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
25840  Summary:
25841  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
25842  Description:
25843  This function identifies whether the FrameSyncPulseCounter feature is available
25844  on the SPI module.
25845  When this function returns true, this function is supported on the device:
25846  - PLIB_SPI_FrameSyncPulseCounterSelect
25847  This operation is atomic.
25848  Preconditions:
25849  None.
25850  Parameters:
25851  index - Identifier for the device instance
25852  Returns:
25853  - true - The FrameSyncPulseCounter feature is supported on the device
25854  - false - The FrameSyncPulseCounter feature is not supported on the device
25855  Remarks:
25856  None.
25857 */
25858 
25859 bool
25861  SPI_MODULE_ID index ) ;
25862 //******************************************************************************
25863 /* Function:
25864  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
25865  Summary:
25866  Identifies whether the FrameErrorStatus feature exists on the SPI module.
25867  Description:
25868  This function identifies whether the FrameErrorStatus feature is available on
25869  the SPI module.
25870  When this function returns true, these functions are supported on the device:
25871  - PLIB_SPI_FrameErrorStatusGet
25872  - PLIB_SPI_FrameErrorStatusClear
25873  This operation is atomic.
25874  Preconditions:
25875  None.
25876  Parameters:
25877  index - Identifier for the device instance
25878  Returns:
25879  - true - The FrameErrorStatus feature is supported on the device
25880  - false - The FrameErrorStatus feature is not supported on the device
25881  Remarks:
25882  None.
25883 */
25884 
25885 bool
25887  SPI_MODULE_ID index ) ;
25888 //******************************************************************************
25889 /* Function:
25890  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
25891  Summary:
25892  Identifies whether the Buffer feature exists on the SPI module.
25893  Description:
25894  This function identifies whether the Buffer feature is available on the SPI module.
25895  When this function returns true, these functions are supported on the device:
25896  - PLIB_SPI_BufferClear
25897  - PLIB_SPI_BufferRead
25898  - PLIB_SPI_BufferWrite
25899  - PLIB_SPI_BufferAddressGet
25900  This operation is atomic.
25901  Preconditions:
25902  None.
25903  Parameters:
25904  index - Identifier for the device instance
25905  Returns:
25906  - true - The Buffer feature is supported on the device
25907  - false - The Buffer feature is not supported on the device
25908  Remarks:
25909  None.
25910 */
25911 
25912 bool
25914  SPI_MODULE_ID index ) ;
25915 //******************************************************************************
25916 /* Function:
25917  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
25918  Summary:
25919  Identifies whether the BaudRateClock feature exists on the SPI module.
25920  Description:
25921  This function identifies whether the BaudRateClock feature is available on
25922  the SPI module.
25923  When this function returns true, this function is supported on the device:
25924  - PLIB_SPI_BaudRateClockSelect
25925  This operation is atomic.
25926  Preconditions:
25927  None.
25928  Parameters:
25929  index - Identifier for the device instance
25930  Returns:
25931  - true - The BaudRateClock feature is supported on the device
25932  - false - The BaudRateClock feature is not supported on the device
25933  Remarks:
25934  None.
25935 */
25936 
25937 bool
25939  SPI_MODULE_ID index ) ;
25940 //******************************************************************************
25941 /* Function:
25942  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
25943  Summary:
25944  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
25945  Description:
25946  This function identifies whether the ErrorInterruptControl feature is available
25947  on the SPI module.
25948  When this function returns true, these functions are supported on the device:
25949  - PLIB_SPI_ErrorInterruptEnable
25950  - PLIB_SPI_ErrorInterruptDisable
25951  This operation is atomic.
25952  Preconditions:
25953  None.
25954  Parameters:
25955  index - Identifier for the device instance
25956  Returns:
25957  - true - The ErrorInterruptControl feature is supported on the device
25958  - false - The ErrorInterruptControl feature is not supported on the device
25959  Remarks:
25960  None.
25961 */
25962 
25963 bool
25965  SPI_MODULE_ID index ) ;
25966 //******************************************************************************
25967 /* Function:
25968  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
25969  Summary:
25970  Identifies whether the AudioErrorControl feature exists on the SPI module.
25971  Description:
25972  This function identifies whether the AudioErrorControl feature is available
25973  on the SPI module.
25974  When this function returns true, these functions are supported on the device:
25975  - PLIB_SPI_AudioErrorEnable
25976  - PLIB_SPI_AudioErrorDisable
25977  This operation is atomic.
25978  Preconditions:
25979  None.
25980  Parameters:
25981  index - Identifier for the device instance
25982  Returns:
25983  - true - The AudioErrorControl feature is supported on the device
25984  - false - The AudioErrorControl feature is not supported on the device
25985  Remarks:
25986  None.
25987 */
25988 
25989 bool
25991  SPI_MODULE_ID index ) ;
25992 //******************************************************************************
25993 /* Function:
25994  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
25995  Summary:
25996  Identifies whether the AudioProtocolControl feature exists on the SPI module.
25997  Description:
25998  This function identifies whether the AudioProtocolControl feature is available
25999  on the SPI module.
26000  When this function returns true, this function is supported on the device:
26001  - PLIB_SPI_AudioProtocolEnable
26002  - PLIB_SPI_AudioProtocolDisable
26003  This operation is atomic.
26004  Preconditions:
26005  None.
26006  Parameters:
26007  index - Identifier for the device instance
26008  Returns:
26009  - true - The AudioProtocolControl feature is supported on the device
26010  - false - The AudioProtocolControl feature is not supported on the device
26011  Remarks:
26012  None.
26013 */
26014 
26015 bool
26017  SPI_MODULE_ID index ) ;
26018 //******************************************************************************
26019 /* Function:
26020  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26021  Summary:
26022  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26023  Description:
26024  This function identifies whether the AudioTransmitMode feature is available
26025  on the SPI module.
26026  When this function returns true, this function is supported on the device:
26027  - PLIB_SPI_AudioTransmitModeSelect
26028  This operation is atomic.
26029  Preconditions:
26030  None.
26031  Parameters:
26032  index - Identifier for the device instance
26033  Returns:
26034  - true - The AudioTransmitMode feature is supported on the device
26035  - false - The AudioTransmitMode feature is not supported on the device
26036  Remarks:
26037  None.
26038 */
26039 
26040 bool
26042  SPI_MODULE_ID index ) ;
26043 //******************************************************************************
26044 /* Function:
26045  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26046  Summary:
26047  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26048  Description:
26049  This function identifies whether the AudioProtocolMode feature is available
26050  on the SPI module.
26051  When this function returns true, this function is supported on the device:
26052  - PLIB_SPI_AudioProtocolModeSelect
26053  This operation is atomic.
26054  Preconditions:
26055  None.
26056  Parameters:
26057  index - Identifier for the device instance
26058  Returns:
26059  - true - The AudioProtocolMode feature is supported on the device
26060  - false - The AudioProtocolMode feature is not supported on the device
26061  Remarks:
26062  None.
26063 */
26064 
26065 bool
26067  SPI_MODULE_ID index ) ;
26068 //******************************************************************************
26069 /* Function:
26070  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26071  Summary:
26072  Identifies whether the Buffer32bit feature exists on the SPI module.
26073  Description:
26074  This function identifies whether the Buffer32bit feature is available on the
26075  SPI module.
26076  When this function returns true, these functions are supported on the device:
26077  - PLIB_SPI_BufferRead32bit
26078  - PLIB_SPI_BufferWrite32bit
26079  This operation is atomic.
26080  Preconditions:
26081  None.
26082  Parameters:
26083  index - Identifier for the device instance
26084  Returns:
26085  - true - The Buffer32bit feature is supported on the device
26086  - false - The Buffer32bit feature is not supported on the device
26087  Remarks:
26088  None.
26089 */
26090 
26091 bool
26093  SPI_MODULE_ID index ) ;
26094 //******************************************************************************
26095 /* Function:
26096  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26097  Summary:
26098  Identifies whether the Buffer16bit feature exists on the SPI module.
26099  Description:
26100  This function identifies whether the Buffer16bit feature is available on the
26101  SPI module.
26102  When this function returns true, these functions are supported on the device:
26103  - PLIB_SPI_BufferRead16bit
26104  - PLIB_SPI_BufferWrite16bit
26105  This operation is atomic.
26106  Preconditions:
26107  None.
26108  Parameters:
26109  index - Identifier for the device instance
26110  Returns:
26111  - true - The Buffer16bit feature is supported on the device
26112  - false - The Buffer16bit feature is not supported on the device
26113  Remarks:
26114  None.
26115 */
26116 
26117 bool
26119  SPI_MODULE_ID index ) ;
26120 //DOM-IGNORE-BEGIN
26121 //DOM-IGNORE-END
26122  // #ifndef _PLIB_SPI_H
26123 /*******************************************************************************
26124  End of File
26125  */
26126 
26127 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26128 /* CLOSE_FILE Include File */
26129 
26130  // SPI PLIB Header
26131 #include "system/common/sys_common.h" // Common System Service Definitions
26132 #include "system/common/sys_module.h" // Module/Driver Definitions
26133 #include "system/int/sys_int.h" // System Interrupt Definitions
26134 #include "system/clk/sys_clk.h"
26135 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26136  /* LDRA full path */
26137 // DOM-IGNORE-BEGIN
26138 // DOM-IGNORE-END
26139 // *****************************************************************************
26140 /* SPI Driver Buffer Handle
26141  Summary:
26142  Handle identifying a read or write buffer passed to the driver.
26143  Description:
26144  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26145  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26146  This handle is associated with the buffer passed into the function and
26147  it allows the application to track the completion of the data from (or into)
26148  that buffer. The buffer handle value returned from the "buffer add" function
26149  is returned back to the client by the "callback" function registered with
26150  the driver.
26151  The buffer handle assigned to a client request expires when the client has
26152  been notified of the completion of the buffer transfer (after event handler
26153  function that notifies the client returns) or after the buffer has been
26154  retired by the driver if no event handler callback was set.
26155  Remarks:
26156  None.
26157 */
26158 
26159 typedef
26160 uintptr_t
26162 // *****************************************************************************
26163 /* SPI Driver Invalid Buffer Handle
26164  Summary:
26165  Definition of an invalid buffer handle.
26166  Description:
26167  This is the definition of an invalid buffer handle. An invalid buffer handle
26168  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26169  function if the buffer add request was not successful.
26170  Remarks:
26171  None.
26172 */
26173 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26174 // *****************************************************************************
26175 /* SPI Driver Module Index Numbers
26176  Summary:
26177  SPI driver index definitions.
26178  Description:
26179  These constants provide the SPI driver index definitions.
26180  Remarks:
26181  These constants should be used in place of hard-coded numeric literals.
26182  These values should be passed into the DRV_SPI_Initialize and
26183  DRV_SPI_Open functions to identify the driver instance in use.
26184 */
26185 #define DRV_SPI_INDEX_0 0
26186 #define DRV_SPI_INDEX_1 1
26187 #define DRV_SPI_INDEX_2 2
26188 #define DRV_SPI_INDEX_3 3
26189 #define DRV_SPI_INDEX_4 4
26190 #define DRV_SPI_INDEX_5 5
26191 // *****************************************************************************
26192 /* SPI Driver Module Index Count
26193  Summary:
26194  Number of valid SPI driver indices.
26195  Description:
26196  This constant identifies the number of valid SPI driver indices.
26197  Remarks:
26198  This constant should be used in place of hard-coded numeric literals.
26199  This value is derived from device-specific header files defined as part
26200  of the peripheral libraries.
26201 */
26202 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26203 // *****************************************************************************
26204 /* SPI Clock Mode Selection
26205  Summary:
26206  Identifies the various clock modes of the SPI module.
26207  Description:
26208  This enumeration identifies the various clock modes of the SPI module.
26209  Remarks:
26210  None.
26211 */
26212 
26213 typedef
26214  enum
26215  {
26216  /* SPI Clock Mode 0:
26217  - Idle State of the clock is Low
26218  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26219  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26221  /*DOM-IGNORE-BEGIN*/
26222  = 0 /*DOM-IGNORE-END*/
26223  ,
26224  /* SPI Clock Mode 1:
26225  - Idle State of the clock is Low
26226  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26227  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26229  /*DOM-IGNORE-BEGIN*/
26230  = 1 /*DOM-IGNORE-END*/
26231  ,
26232  /* SPI Clock Mode 2:
26233  - Idle State of the clock is High
26234  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26235  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26237  /*DOM-IGNORE-BEGIN*/
26238  = 2 /*DOM-IGNORE-END*/
26239  ,
26240  /* SPI Clock Mode 3:
26241  - Idle State of the clock is High
26242  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26243  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26245  /*DOM-IGNORE-BEGIN*/
26246  = 3 /*DOM-IGNORE-END*/
26247  } DRV_SPI_CLOCK_MODE ;
26248 // *****************************************************************************
26249 /* SPI Buffer Type Selection
26250  Summary:
26251  Identifies the various buffer types of the SPI module.
26252  Description:
26253  This enumeration identifies the various buffer types of the SPI module.
26254  Remarks:
26255  None.
26256 */
26257 
26258 typedef
26259  enum
26260  {
26261  /* SPI Buffer Type Standard */
26263  /*DOM-IGNORE-BEGIN*/
26264  = 0 /*DOM-IGNORE-END*/
26265  ,
26266  /* SPI Enhanced Buffer Type */
26268  /*DOM-IGNORE-BEGIN*/
26269  = 1 /*DOM-IGNORE-END*/
26271 // *****************************************************************************
26272 /* SPI Protocols Enumeration
26273  Summary:
26274  Identifies the various protocols of the SPI module.
26275  Description:
26276  This enumeration identifies the various protocols of the SPI module.
26277  Remarks:
26278  None.
26279 */
26280 
26281 typedef
26282  enum
26283  {
26284  /* SPI Protocol Type Standard */
26286  /*DOM-IGNORE-BEGIN*/
26287  = 0 /*DOM-IGNORE-END*/
26288  ,
26289  /* SPI Protocol Type Framed */
26291  /*DOM-IGNORE-BEGIN*/
26292  = 1 /*DOM-IGNORE-END*/
26293  ,
26294  /*SPI Protocol Type Audio*/
26296  /*DOM-IGNORE-BEGIN*/
26297  = 2 /*DOM-IGNORE-END*/
26299 // *****************************************************************************
26300 /* SPI Driver Buffer Events
26301  Summary
26302  Identifies the possible events that can result from a buffer add request.
26303  Description
26304  This enumeration identifies the possible events that can result from a
26305  buffer add request caused by the client calling either
26306  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26307  Remarks:
26308  One of these values is passed in the "event" parameter of the event
26309  handling callback function that the client registered during buffer add
26310  requests.
26311 */
26312 
26313 typedef
26314  enum
26315  {
26316  /* Buffer is pending to get processed */
26318  /* Buffer is being processed */
26320  /* All data from or to the buffer was transferred successfully. */
26322  /* There was an error while processing the buffer transfer request. */
26325 // *****************************************************************************
26326 /* SPI Usage Modes Enumeration
26327  Summary:
26328  Identifies the various usage modes of the SPI module.
26329  Description:
26330  This enumeration identifies the various usage modes of the SPI module.
26331  Remarks:
26332  None.
26333 */
26334 
26335 typedef
26336  enum
26337  {
26338  /* SPI Mode Master */
26340  /*DOM-IGNORE-BEGIN*/
26341  = 0 /*DOM-IGNORE-END*/
26342  ,
26343  /* SPI Mode Slave */
26345  /*DOM-IGNORE-BEGIN*/
26346  = 1 /*DOM-IGNORE-END*/
26347  } DRV_SPI_MODE ;
26348 // *****************************************************************************
26349 /* SPI Task Modes Enumeration
26350  Summary:
26351  Identifies the various modes of how the tasks function will be run.
26352  Description:
26353  This enumeration identifies the various tasks mode
26354  Remarks:
26355  None.
26356 */
26357 
26358 typedef
26359  enum
26360  {
26361  /* Task is configured to run in polled mode */
26363  /*DOM-IGNORE-BEGIN*/
26364  = 0 /*DOM-IGNORE-END*/
26365  ,
26366  /* Task is configured to run in interrupt mode */
26368  /*DOM-IGNORE-BEGIN*/
26369  = 1 /*DOM-IGNORE-END*/
26370  } DRV_SPI_TASK_MODE ;
26371 // *****************************************************************************
26372 /* SPI Driver Buffer Event Handler Function Pointer
26373  Summary:
26374  Pointer to a SPI Driver Buffer Event handler function
26375  Description:
26376  This data type defines the required function signature for the SPI driver
26377  buffer event handling callback function. A client must register a pointer
26378  to a buffer event handling function who's function signature (parameter
26379  and return value types) match the types specified by this function pointer
26380  in order to receive buffer related event calls back from the driver.
26381  The parameters and return values and return value are described here and
26382  a partial example implementation is provided.
26383  Parameters:
26384  event - Identifies the type of event
26385  bufferHandle - Handle identifying the buffer to which the vent relates
26386  context - Value identifying the context of the application that
26387  registered the event handling function.
26388  Returns:
26389  None.
26390  Example:
26391  <code>
26392  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26393  DRV_SPI_BUFFER_HANDLE bufferHandle,
26394  uintptr_t context )
26395  {
26396  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26397  switch(event)
26398  {
26399  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26400  // Handle the completed buffer.
26401  break;
26402  case DRV_SPI_BUFFER_EVENT_ERROR:
26403  default:
26404  // Handle error.
26405  break;
26406  }
26407  }
26408  </code>
26409  Remarks:
26410  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26411  transferred successfully.
26412  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26413  not transferred successfully.
26414  The bufferHandle parameter contains the buffer handle of the buffer that
26415  failed.
26416  The context parameter contains the a handle to the client context,
26417  provided at the time the event handling function registration.
26418  This context handle value is passed back to the client as the "context"
26419  parameter. It can be any value necessary to identify the client context
26420  or instance (such as a pointer to the client's data) instance of the
26421  client that made the buffer add request.
26422  The event handler function executes in an interrupt context when the driver
26423  is configured for interrupt mode operation. It is recommended of the
26424  application to not perform process intensive operations with in this
26425  function.
26426 */
26427 
26428 typedef
26430 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26431 void * context ) ;
26432 // *****************************************************************************
26433 /* SPI Driver Initialization Data
26434  Summary:
26435  Defines the data required to initialize or reinitialize the SPI driver
26436  Description:
26437  This data type defines the data required to initialize or reinitialize the
26438  SPI driver. If the driver is built statically, the members of this data
26439  structure are statically over-ridden by static override definitions in the
26440  system_config.h file.
26441  Remarks:
26442  None.
26443 */
26444 
26445 typedef
26446 struct _DRV_SPI_INIT
26447 {
26448  /* System module initialization */
26449  SYS_MODULE_INIT moduleInit ;
26450  /* Identifies peripheral (PLIB-level) ID */
26451  SPI_MODULE_ID spiId ;
26452  /* SPI Task Mode Type*/
26454  /* SPI Usage Mode Type */
26456  /* Allow SPI to run when CPU goes to idle mode*/
26457  bool allowIdleRun ;
26458  /* SPI Protocol Type */
26460  /* SPI Slave Mode SSx Pin Select */
26461  bool spiSlaveSSPin ;
26462  /* Framed mode Sync Pulse*/
26463  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26464  /* Framed Mode pulse polarity*/
26465  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26466  /* Framed Mode Pulse Direction*/
26467  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26468  /* Framed mode Pulse Edge*/
26469  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26470  /* Framed Mode Pulse width */
26471  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26472  /* Audio mode transmit mode*/
26473  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26474  /* Audio mode protocol mode*/
26475  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26476  /* Communication Width */
26477  SPI_COMMUNICATION_WIDTH commWidth ;
26478  /* SPI clock source which generates required baud rate.
26479  It can be either PBCLK or Reference Clock */
26480  SPI_BAUD_RATE_CLOCK baudClockSource ;
26481  /* when Baud rate clock source is peripheral clock, then this element is
26482  used to define which peripheral bus clock is used for this particular
26483  SPI instance. */
26484  CLK_BUSES_PERIPHERAL spiClk ;
26485  /* Baud Rate Value */
26486  uint32_t baudRate ;
26487  /* SPI Buffer Type */
26489  /* SPI Clock mode */
26491  /* SPI Input Sample Phase Selection */
26492  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26493  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26494  INT_SOURCE txInterruptSource ;
26495  /* Receive Interrupt Source for SPI module */
26496  INT_SOURCE rxInterruptSource ;
26497  /* Error Interrupt Source for SPI module */
26498  INT_SOURCE errInterruptSource ;
26499  /* While using standard buffer and polled mode how many transfers to do
26500  before yielding to other tasks*/
26501  uint8_t numTrfsSmPolled ;
26502  /* Dummy byte value which will be used for dummy transmission */
26503  uint32_t dummyByteValue ;
26504  /* This is the buffer queue size. This is the maximum
26505  number of transfer requests that driver will queue. */
26506  uint8_t queueSize ;
26507  /* This controls the minimum number of jobs that the driver will be able
26508  to accept without running out of memory. The driver will reserve this
26509  number of jobs from the global SPI queue so that it will always be available*/
26510  uint8_t jobQueueReserveSize ;
26511  /* This callback is fired when an operation is about to start on the
26512  SPI bus. This allows the user to set any pins that need to be set.
26513  This callback may be called from an ISR so should not include OSAL
26514  calls. The context parameter is the same one passed into the
26515  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26516  */
26518  /* This callback is fired when an operation has just completed on the
26519  SPI bus. This allows the user to set any pins that need to be set.
26520  This callback may be called from an ISR so should not include OSAL
26521  calls. The context parameter is the same one passed into the
26522  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26523  */
26525 } DRV_SPI_INIT ;
26526 // *****************************************************************************
26527 /* SPI Driver Client Specific Configuration
26528  Summary:
26529  Defines the data that can be changed per client.
26530  Description:
26531  This data type defines the data can be configured per client. This data can
26532  be per client, and overrides the configuration data contained inside of
26533  DRV_SPI_INIT.
26534  Remarks:
26535  None.
26536 */
26537 
26538 typedef
26539 struct _DRV_SPI_CLIENT_DATA
26540 {
26541  /* Baud Rate Value */
26542  uint32_t baudRate ;
26543  /* This callback is fired when an operation is about to start on the
26544  SPI bus. This allows the user to set any pins that need to be set.
26545  This callback may be called from an ISR so should not include OSAL
26546  calls. The context parameter is the same one passed into the
26547  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26548  */
26550  /* This callback is fired when an operation has just completed on the
26551  SPI bus. This allows the user to set any pins that need to be set.
26552  This callback may be called from an ISR so should not include OSAL
26553  calls. The context parameter is the same one passed into the
26554  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26555  */
26558 //DOM-IGNORE-BEGIN
26559 //DOM-IGNORE-END
26560  // #ifndef _DRV_SPI_DEFINITIONS_H
26561 /*******************************************************************************
26562  End of File
26563 */
26564 
26565 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
26566 /* CLOSE_FILE Include File */
26567 
26568 // DOM-IGNORE-BEGIN
26569 // DOM-IGNORE-END
26570 // *****************************************************************************
26571 // *****************************************************************************
26572 // Section: Interface Routines - System Level
26573 // *****************************************************************************
26574 // *****************************************************************************
26575 // *****************************************************************************
26576 /* Function:
26577  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
26578  const SYS_MODULE_INIT * const init )
26579  Summary:
26580  Initializes the SPI instance for the specified driver index.
26581  <p><b>Implementation:</b> Static/Dynamic</p>
26582  Description:
26583  This routine initializes the SPI driver instance for the specified driver
26584  index, making it ready for clients to open and use it. The initialization
26585  data is specified by the 'init' parameter. The initialization may fail if the
26586  number of driver objects allocated are insufficient or if the specified
26587  driver instance is already initialized. The driver instance index is
26588  independent of the SPI module ID. For example, driver instance 0 can be
26589  assigned to SPI2. If the driver is built statically, then some of the
26590  initialization parameters are overridden by configuration macros. Refer to
26591  the description of the DRV_SPI_INIT data structure for more details on
26592  which members on this data structure are overridden.
26593  Precondition:
26594  None.
26595  Parameters:
26596  index - Identifier for the instance to be initialized. Please note this
26597  is not the SPI id. The hardware SPI id is set in the initialization
26598  structure. This is the index of the driver index to use.
26599  init - Pointer to a data structure containing any data necessary to
26600  initialize the driver. If this pointer is NULL, the driver
26601  uses the static initialization override macros for each
26602  member of the initialization data structure.
26603  Returns:
26604  - If successful - returns a valid handle to a driver instance object
26605  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
26606  Example:
26607  <code>
26608  DRV_SPI_INIT init;
26609  SYS_MODULE_OBJ objectHandle;
26610  // Populate the SPI initialization structure
26611  init.spiId = SPI_ID_1,
26612  init.taskMode = DRV_SPI_TASK_MODE_ISR,
26613  init.spiMode = DRV_SPI_MODE_MASTER,
26614  init.allowIdleRun = false,
26615  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
26616  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
26617  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
26618  init.spiClk = CLK_BUS_PERIPHERAL_2,
26619  init.baudRate = 10000000,
26620  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
26621  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
26622  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
26623  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
26624  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
26625  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
26626  init.dummyByteValue = 0xFF,
26627  init.queueSize = 10,
26628  init.jobQueueReserveSize = 1,
26629  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
26630  if (SYS_MODULE_OBJ_INVALID == objectHandle)
26631  {
26632  // Handle error
26633  }
26634  </code>
26635  Remarks:
26636  This routine must be called before any other SPI routine is called.
26637  This routine should only be called once during system initialization
26638  unless DRV_SPI_Deinitialize is called to deinitialize the driver
26639  instance. This routine will NEVER block for hardware access.
26640 */
26641 
26642 SYS_MODULE_OBJ
26644  const SYS_MODULE_INDEX index ,
26645  const SYS_MODULE_INIT * const init ) ;
26646 //*************************************************************************
26647 /* Function:
26648  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
26649  Summary:
26650  Deinitializes the specified instance of the SPI driver module.
26651  <p><b>Implementation:</b> Static/Dynamic</p>
26652  Description:
26653  Deinitializes the specified instance of the SPI driver module,
26654  disabling its operation (and any hardware) and invalidates all of the
26655  internal data.
26656  Precondition:
26657  Function DRV_SPI_Initialize must have been called before calling this
26658  routine and a valid SYS_MODULE_OBJ must have been returned.
26659  Parameters:
26660  object - Driver object handle, returned from DRV_SPI_Initialize
26661  Returns:
26662  None.
26663  Example:
26664  <code>
26665  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26666  SYS_STATUS status;
26667  DRV_SPI_Deinitialize ( object );
26668  status = DRV_SPI_Status( object );
26669  if( SYS_MODULE_UNINITIALIZED == status )
26670  {
26671  // Check again later if you need to know
26672  // when the driver is deinitialized.
26673  }
26674  </code>
26675  Remarks:
26676  Once the Initialize operation has been called, the De-initialize
26677  operation must be called before the Initialize operation can be called
26678  again.
26679  This function will NEVER block waiting for hardware. If the operation
26680  requires time to allow the hardware to complete, this will be reported
26681  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
26682  to find out when the module is in the ready state.
26683 */
26684 
26685 void
26687  SYS_MODULE_OBJ object ) ;
26688 //**************************************************************************
26689 /* Function:
26690  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
26691  Summary:
26692  Provides the current status of the SPI driver module.
26693  <p><b>Implementation:</b> Static/Dynamic</p>
26694  Description:
26695  This function provides the current status of the SPI driver module.
26696  Precondition:
26697  The DRV_SPI_Initialize function must have been called before calling
26698  this function.
26699  Parameters:
26700  object - Driver object handle, returned from DRV_SPI_Initialize
26701  Returns:
26702  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
26703  system level operation and cannot start another
26704  Example:
26705  <code>
26706  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26707  SYS_STATUS status;
26708  status = DRV_SPI_Status( object );
26709  if( SYS_STATUS_READY != status )
26710  {
26711  // Handle error
26712  }
26713  </code>
26714  Remarks:
26715  Any value greater than SYS_STATUS_READY is also a normal running state
26716  in which the driver is ready to accept new operations.
26717  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
26718  deinitialized
26719  This value is less than SYS_STATUS_ERROR.
26720  This function can be used to determine when any of the driver's module
26721  level operations has completed.
26722  If the status operation returns SYS_STATUS_BUSY, the previous operation
26723  has not yet completed. Once the status operation returns
26724  SYS_STATUS_READY, any previous operations have completed.
26725  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
26726  that is also an error state.
26727  This function will NEVER block waiting for hardware.
26728  If the Status operation returns an error value, the error may be
26729  cleared by calling the reinitialize operation. If that fails, the
26730  deinitialize operation will need to be called, followed by the
26731  initialize operation to return to normal operations.
26732 */
26733 
26734 SYS_STATUS
26735  DRV_SPI_Status (
26736  SYS_MODULE_OBJ object ) ;
26737 // *****************************************************************************
26738 /* Function:
26739  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
26740  Summary:
26741  Maintains the driver's state machine and implements its ISR.
26742  <p><b>Implementation:</b> Static/Dynamic</p>
26743  Description:
26744  This routine is used to maintain the driver's internal state
26745  machine and implement its transmit ISR for interrupt-driven implementations.
26746  In polling mode, this function should be called from the SYS_Tasks()
26747  function. In interrupt mode, this function should be called in the transmit
26748  interrupt service routine of the USART that is associated with this USART
26749  driver hardware instance.
26750  Precondition:
26751  The DRV_SPI_Initialize routine must have been called for the specified
26752  SPI driver instance.
26753  Parameters:
26754  object - Object handle for the specified driver instance (returned from
26755  DRV_SPI_Initialize)
26756  Returns:
26757  None.
26758  Example:
26759  <code>
26760  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26761  while( true )
26762  {
26763  DRV_SPI_Tasks ( object );
26764  // Do other tasks
26765  }
26766  </code>
26767  Remarks:
26768  This function is normally not called directly by an application. It is
26769  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
26770  ISR.
26771  This function may execute in an ISR context and will never block or access any
26772  resources that may cause it to block.
26773 */
26774 
26775 void
26776  DRV_SPI_Tasks (
26777  SYS_MODULE_OBJ object ) ;
26778 // *****************************************************************************
26779 // *****************************************************************************
26780 // Section: Interface Routines - Client Level
26781 // *****************************************************************************
26782 // *****************************************************************************
26783 //**************************************************************************
26784 /* Function:
26785  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
26786  const DRV_IO_INTENT ioIntent )
26787  Summary:
26788  Opens the specified SPI driver instance and returns a handle to it.
26789  <p><b>Implementation:</b> Static/Dynamic</p>
26790  Description:
26791  This routine opens the specified SPI driver instance and provides a
26792  handle that must be provided to all other client-level operations to
26793  identify the caller and the instance of the driver. The ioIntent
26794  parameter defines how the client interacts with this driver instance.
26795  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
26796  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
26797  able to write to the driver. If the ioIntent in
26798  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
26799  write.
26800  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
26801  exclusive access to this client. The driver cannot be opened by any
26802  other client.
26803  Precondition:
26804  The DRV_SPI_Initialize function must have been called before calling
26805  this function.
26806  Parameters:
26807  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
26808  Please note this is not the SPI ID.
26809  ioIntent - Zero or more of the values from the enumeration
26810  DRV_IO_INTENT ORed together to indicate the intended use of
26811  the driver
26812  Returns:
26813  If successful, the routine returns a valid open-instance handle (a
26814  number identifying both the caller and the module instance).
26815  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
26816  can occur when the following is true:
26817  * if the number of client objects allocated via
26818  DRV_SPI_INSTANCES_NUMBER is insufficient
26819  * if the client is trying to open the driver but driver has been
26820  opened exclusively by another client
26821  * if the driver hardware instance being opened is not initialized or
26822  is invalid
26823  Example:
26824  <code>
26825  DRV_HANDLE handle;
26826  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
26827  if( DRV_HANDLE_INVALID == handle )
26828  {
26829  // Unable to open the driver
26830  }
26831  </code>
26832  Remarks:
26833  The handle returned is valid until the DRV_SPI_Close routine is
26834  called. This routine will NEVER block waiting for hardware. If the
26835  requested intent flags are not supported, the routine will return
26836  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
26837  It should not be called in an ISR.
26838 */
26839 
26840 DRV_HANDLE
26841  DRV_SPI_Open (
26842  const SYS_MODULE_INDEX drvIndex ,
26843  const DRV_IO_INTENT ioIntent ) ;
26844 //**************************************************************************
26845 /* Function:
26846  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
26847  const DRV_SPI_CLIENT_DATA * cfgData )
26848  Summary:
26849  Configures a SPI client with specific data.
26850  <p><b>Implementation:</b> Static/Dynamic</p>
26851  Description:
26852  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
26853  Whenever a new SPI job is started these values will be used. Passing in NULL will
26854  reset the client back to configuration parameters passed to driver initialization.
26855  A zero in any of the structure elements will reset that specific configuration back
26856  to the driver default.
26857  Precondition:
26858  The DRV_SPI_Open function must have been called before calling
26859  this function.
26860  Parameters:
26861  handle - handle of the client returned by DRV_SPI_Open.
26862  cfgData - Client-specific configuration data.
26863  Returns:
26864  - If successful - the routing will return greater than or equal to zero
26865  - If an error occurs - the return value is negative
26866 */
26867 
26868 int32_t
26870  DRV_HANDLE handle ,
26871  const DRV_SPI_CLIENT_DATA * cfgData ) ;
26872 // *****************************************************************************
26873 /* Function:
26874  void DRV_SPI_Close ( DRV_HANDLE handle )
26875  Summary:
26876  Closes an opened instance of the SPI driver.
26877  <p><b>Implementation:</b> Static/Dynamic</p>
26878  Description:
26879  This function closes an opened instance of the SPI driver, invalidating the
26880  handle.
26881  Precondition:
26882  The DRV_SPI_Initialize routine must have been called for the specified
26883  SPI driver instance.
26884  DRV_SPI_Open must have been called to obtain a valid opened device handle.
26885  Parameters:
26886  handle - A valid open-instance handle, returned from the driver's
26887  open routine
26888  Returns:
26889  None.
26890  Example:
26891  <code>
26892  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26893  DRV_SPI_Close ( handle );
26894  </code>
26895  Remarks:
26896  After calling this routine, the handle passed in "handle" must not be used
26897  with any of the remaining driver routines. A new handle must be obtained by
26898  calling DRV_SPI_Open before the caller may use the driver again. This
26899  function is thread safe in a RTOS application.
26900  Note:
26901  Usually there is no need for the driver client to verify that the Close
26902  operation has completed.
26903 */
26904 
26905 void
26906  DRV_SPI_Close (
26907  DRV_HANDLE handle ) ;
26908 // *****************************************************************************
26909 // *****************************************************************************
26910 // Section: Interface Routines - Client level Read & Write APIs
26911 // *****************************************************************************
26912 // *****************************************************************************
26913 /* These are non-blocking APIs. It doesn't wait until the operation gets
26914  finished. The actual operation will happen it the task routine. The status of
26915  this operation can be monitored using DRV_SPI_BufferStatus function. In
26916  polling mode, User must ensure that the code gets time to execute the task
26917  routine. */
26918 //*******************************************************************************
26919 /* Function:
26920  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
26921  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26922  void * context )
26923  Summary:
26924  Registers a buffer for a read operation. Actual transfer will happen in
26925  the Task function.
26926  <p><b>Implementation:</b> Static/Dynamic</p>
26927  Description:
26928  Registers a buffer for a read operation. Actual transfer will happen in
26929  the Task function. The status of this operation can be monitored using
26930  DRV_SPI_BufferStatus function. A optional callback can also be
26931  provided that will be called when the operation is complete.
26932  Precondition:
26933  The DRV_SPI_Initialize routine must have been called for the specified
26934  SPI driver instance.
26935  DRV_SPI_Open must have been called to obtain a valid opened device
26936  handle.
26937  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
26938  in the DRV_SPI_Open call.
26939  Parameters:
26940  handle - A valid open-instance handle, returned from the driver's
26941  open routine
26942  rxBuffer - The buffer to which the data should be written to.
26943  size - Number of bytes to be read from the SPI bus.
26944  completeCB - Pointer to a function to be called when this queued operation is complete.
26945  context - unused by the driver but this is passed to the callback when it is called.
26946  Returns:
26947  If the buffer add request is successful, a valid buffer handle is returned.
26948  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
26949  Example:
26950  <code>
26951  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26952  char myBuffer[MY_BUFFER_SIZE], state = 0;
26953  DRV_SPI_BUFFER_HANDLE bufferHandle;
26954  switch ( state )
26955  {
26956  case 0:
26957  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
26958  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
26959  {
26960  state++;
26961  }
26962  break;
26963  case 1:
26964  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
26965  {
26966  state++;
26967  // All transmitter data has been sent successfully.
26968  }
26969  break;
26970  }
26971  </code>
26972  Remarks:
26973  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
26974  instead of it.
26975  */
26976 
26979  DRV_HANDLE handle ,
26980  void * rxBuffer ,
26981  size_t size ,
26982  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
26983  void * context ) ;
26984 //*******************************************************************************
26985 /* Function:
26986  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
26987  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26988  void * context )
26989  Summary:
26990  Registers a buffer for a write operation. Actual transfer will happen
26991  in the Task function.
26992  <p><b>Implementation:</b> Static/Dynamic</p>
26993  Description:
26994  Registers a buffer for a write operation. Actual transfer will happen
26995  in the Task function. The status of this operation can be monitored
26996  using DRV_SPI_BufferStatus function. A optional callback can also be
26997  provided that will be called when the operation is complete.
26998  Precondition:
26999  The DRV_SPI_Initialize routine must have been called for the specified
27000  SPI driver instance.
27001  DRV_SPI_Open must have been called to obtain a valid opened device
27002  handle.
27003  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27004  in the DRV_SPI_Open call.
27005  Parameters:
27006  handle - A valid open-instance handle, returned from the driver's
27007  open routine
27008  txBuffer - The buffer which hold the data.
27009  size - Number of bytes to be written to the SPI bus.
27010  completeCB - Pointer to a function to be called when this queued operation is complete
27011  context - unused by the driver but this is passed to the callback when it is called
27012  Returns:
27013  If the buffer add request is successful, a valid buffer handle is returned.
27014  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27015  Example:
27016  <code>
27017  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27018  char myBuffer[MY_BUFFER_SIZE], state = 0;
27019  DRV_SPI_BUFFER_HANDLE bufferHandle;
27020  switch ( state )
27021  {
27022  case 0:
27023  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27024  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27025  {
27026  state++;
27027  }
27028  break;
27029  case 1:
27030  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27031  {
27032  state++;
27033  // All transmitter data has been sent successfully.
27034  }
27035  break;
27036  }
27037  </code>
27038  Remarks:
27039  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27040  instead of it.
27041 */
27042 
27045  DRV_HANDLE handle ,
27046  void * txBuffer ,
27047  size_t size ,
27048  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27049  void * context ) ;
27050 //*******************************************************************************
27051 /* Function:
27052  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27053  void *txBuffer, void *rxBuffer, size_t size, )
27054  Summary:
27055  Registers a buffer for a read and write operation. Actual transfer will
27056  happen in the Task function.
27057  <p><b>Implementation:</b> Static/Dynamic</p>
27058  Description:
27059  Registers a buffer for a read and write operation. Actual transfer will
27060  happen in the Task function. The status of this operation can be
27061  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27062  provided that will be called when the operation is complete.
27063  Precondition:
27064  The DRV_SPI_Initialize routine must have been called for the specified
27065  SPI driver instance.
27066  DRV_SPI_Open must have been called to obtain a valid opened device
27067  handle.
27068  Parameters:
27069  handle - A valid open-instance handle, returned from the driver's
27070  open routine
27071  txBuffer - The buffer which hold the data.
27072  txSize - Number of bytes to be written to the SPI bus.
27073  rxBuffer - The buffer to which the data should be written to.
27074  rxSize - Number of bytes to be read from the SPI bus
27075  completeCB - Pointer to a function to be called when this queued operation is complete
27076  context - unused by the driver but this is passed to the callback when it is called
27077  Returns:
27078  If the buffer add request is successful, a valid buffer handle is returned.
27079  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27080  Example:
27081  <code>
27082  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27083  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27084  DRV_SPI_BUFFER_HANDLE bufferHandle;
27085  switch ( state )
27086  {
27087  case 0:
27088  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27089  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27090  {
27091  state++;
27092  }
27093  break;
27094  case 1:
27095  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27096  {
27097  state++;
27098  // All transmitter data has been sent successfully.
27099  }
27100  break;
27101  }
27102  </code>
27103  Remarks:
27104  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27105  instead of it.
27106 */
27107 
27110  DRV_HANDLE handle ,
27111  void * txBuffer ,
27112  size_t txSize ,
27113  void * rxBuffer ,
27114  size_t rxSize ,
27115  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27116  void * context ) ;
27117 //*******************************************************************************
27118 /* Function:
27119  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27120  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27121  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27122  Summary:
27123  Registers a buffer for a read operation. Actual transfer will happen in
27124  the Task function.
27125  <p><b>Implementation:</b> Static/Dynamic</p>
27126  Description:
27127  Registers a buffer for a read operation. Actual transfer will happen in
27128  the Task function. The status of this operation can be monitored using
27129  DRV_SPI_BufferStatus function. A optional callback can also be
27130  provided that will be called when the operation is complete.
27131  Precondition:
27132  The DRV_SPI_Initialize routine must have been called for the specified
27133  SPI driver instance.
27134  DRV_SPI_Open must have been called to obtain a valid opened device
27135  handle.
27136  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27137  in the DRV_SPI_Open call.
27138  Parameters:
27139  handle - A valid open-instance handle, returned from the driver's
27140  open routine
27141  rxBuffer - The buffer to which the data should be written to.
27142  size - Number of bytes to be read from the SPI bus.
27143  completeCB - Pointer to a function to be called when this queued operation is complete
27144  context - unused by the driver but this is passed to the callback when it is called
27145  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27146  Returns:
27147  If the buffer add request is successful, a valid buffer handle is returned.
27148  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27149  Example:
27150  <code>
27151  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27152  char myBuffer[MY_BUFFER_SIZE], state = 0;
27153  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27154  switch ( state )
27155  {
27156  case 0:
27157  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27158  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27159  {
27160  state++;
27161  }
27162  break;
27163  case 1:
27164  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27165  {
27166  state++;
27167  // All transmitter data has been sent successfully.
27168  }
27169  break;
27170  }
27171  </code>
27172  Remarks:
27173  None.
27174  */
27175 
27178  DRV_HANDLE handle ,
27179  void * rxBuffer ,
27180  size_t size ,
27181  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27182  void * context ,
27183  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27184 //*******************************************************************************
27185 /* Function:
27186  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27187  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27188  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27189  Summary:
27190  Registers a buffer for a write operation. Actual transfer will happen
27191  in the Task function.
27192  <p><b>Implementation:</b> Static/Dynamic</p>
27193  Description:
27194  Registers a buffer for a write operation. Actual transfer will happen
27195  in the Task function. The status of this operation can be monitored
27196  using DRV_SPI_BufferStatus function. A optional callback can also be
27197  provided that will be called when the operation is complete.
27198  Precondition:
27199  The DRV_SPI_Initialize routine must have been called for the specified
27200  SPI driver instance.
27201  DRV_SPI_Open must have been called to obtain a valid opened device
27202  handle.
27203  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27204  in the DRV_SPI_Open call.
27205  Parameters:
27206  handle - A valid open-instance handle, returned from the driver's
27207  open routine
27208  txBuffer - The buffer which hold the data.
27209  size - Number of bytes to be written to the SPI bus.
27210  completeCB - Pointer to a function to be called when this queued operation is complete
27211  context - unused by the driver but this is passed to the callback when it is called
27212  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27213  Returns:
27214  If the buffer add request is successful, a valid buffer handle is returned.
27215  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27216  Example:
27217  <code>
27218  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27219  char myBuffer[MY_BUFFER_SIZE], state = 0;
27220  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27221  switch ( state )
27222  {
27223  case 0:
27224  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27225  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27226  {
27227  state++;
27228  }
27229  break;
27230  case 1:
27231  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27232  {
27233  state++;
27234  // All transmitter data has been sent successfully.
27235  }
27236  break;
27237  }
27238  </code>
27239  Remarks:
27240  None.
27241 */
27242 
27245  DRV_HANDLE handle ,
27246  void * txBuffer ,
27247  size_t size ,
27248  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27249  void * context ,
27250  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27251 //*******************************************************************************
27252 /* Function:
27253  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27254  void *txBuffer, void *rxBuffer, size_t size,
27255  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27256  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27257  Summary:
27258  Registers a buffer for a read and write operation. Actual transfer will
27259  happen in the Task function.
27260  <p><b>Implementation:</b> Static/Dynamic</p>
27261  Description:
27262  Registers a buffer for a read and write operation. Actual transfer will
27263  happen in the Task function. The status of this operation can be
27264  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27265  provided that will be called when the operation is complete.
27266  Precondition:
27267  The DRV_SPI_Initialize routine must have been called for the specified
27268  SPI driver instance.
27269  DRV_SPI_Open must have been called to obtain a valid opened device
27270  handle.
27271  Parameters:
27272  handle - A valid open-instance handle, returned from the driver's
27273  open routine
27274  txBuffer - The buffer which hold the data.
27275  txSize - Number of bytes to be written to the SPI bus.
27276  rxBuffer - The buffer to which the data should be written to.
27277  rxSize - Number of bytes to be read from the SPI bus
27278  completeCB - Pointer to a function to be called when this queued operation is complete
27279  context - unused by the driver but this is passed to the callback when it is called
27280  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27281  Returns:
27282  If the buffer add request is successful, a valid buffer handle is returned.
27283  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27284  Example:
27285  <code>
27286  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27287  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27288  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27289  switch ( state )
27290  {
27291  case 0:
27292  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27293  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27294  {
27295  state++;
27296  }
27297  break;
27298  case 1:
27299  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27300  {
27301  state++;
27302  // All transmitter data has been sent successfully.
27303  }
27304  break;
27305  }
27306  </code>
27307  Remarks:
27308  None.
27309 */
27310 
27313  DRV_HANDLE handle ,
27314  void * txBuffer ,
27315  size_t txSize ,
27316  void * rxBuffer ,
27317  size_t rxSize ,
27318  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27319  void * context ,
27320  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27321 // *****************************************************************************
27322 /* Function:
27323  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27324  Summary:
27325  Returns the transmitter and receiver transfer status.
27326  <p><b>Implementation:</b> Static/Dynamic</p>
27327  Description:
27328  This returns the transmitter and receiver transfer status.
27329  Precondition:
27330  The DRV_SPI_Initialize routine must have been called for the specified
27331  SPI driver instance.
27332  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27333  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27334  the buffer handle associated with that transfer.
27335  Parameters:
27336  bufferHandle - A valid buffer handle, returned from the driver's
27337  data transfer routine
27338  Returns:
27339  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27340  transfer.
27341  Example:
27342  <code>
27343  // Buffer handle returned from the data transfer function
27344  DRV_SPI_BUFFER_HANDLE bufferHandle;
27345  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27346  {
27347  // All transmitter data has been sent.
27348  }
27349  </code>
27350  Remarks:
27351  The returned status may contain a value with more than one of the bits
27352  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27353  should perform an AND with the bit of interest and verify if the
27354  result is non-zero (as shown in the example) to verify the desired status
27355  bit.
27356 */
27357 
27360  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27361 // *****************************************************************************
27362 /* Function:
27363  bool DRV_SPIn_ReceiverBufferIsFull(void)
27364  Summary:
27365  Returns the receive buffer status. 'n' represents the instance of the
27366  SPI driver used.
27367  <p><b>Implementation:</b> Static</p>
27368  Description:
27369  This function returns the receive buffer status (full/empty).
27370  Precondition:
27371  None.
27372  Parameters:
27373  None.
27374  Returns:
27375  Receive Buffer Status
27376  - 1 - Full
27377  - 0 - Empty
27378  Example:
27379  <code>
27380  bool rxBufStat;
27381  // Using instance 1 of SPI driver, that is n = 1
27382  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27383  if (rxBufStat)
27384  {
27385  ...
27386  }
27387  </code>
27388  Remarks:
27389  None.
27390 */
27391 
27392 bool
27394 // *****************************************************************************
27395 /* Function:
27396  bool DRV_SPIn_TransmitterBufferIsFull(void)
27397  Summary:
27398  Returns the transmit buffer status. 'n' represents the instance of the
27399  SPI driver used.
27400  <p><b>Implementation:</b> Static</p>
27401  Description:
27402  This function returns the transmit buffer status (full/empty).
27403  Precondition:
27404  None.
27405  Parameters:
27406  None.
27407  Returns:
27408  Transmit Buffer Status
27409  - 1 - Full
27410  - 0 - Empty
27411  Example:
27412  <code>
27413  bool txBufStat;
27414  // Using instance 1 of SPI driver, that is n = 1
27415  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27416  if (txBufStat)
27417  {
27418  ...
27419  }
27420  </code>
27421  Remarks:
27422  None.
27423 */
27424 
27425 bool
27427 //DOM-IGNORE-BEGIN
27428 //DOM-IGNORE-END
27429  // #ifndef _DRV_SPI_H
27430 /*******************************************************************************
27431  End of File
27432 */
27433 
27434 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27435 /* CLOSE_FILE Include File */
27436 
27437 #include "driver/usb/usbhs/drv_usbhs.h"
27438 #include "usb/usb_device.h"
27439 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27440 /**************************************************************************************/
27441 /* LDRA_INSPECTED 110 S
27442 */
27458 /**************************************************************************************/
27459 #ifndef APP_H /* Guard against multiple inclusion.*/
27460 #define APP_H
27461 /**************************************************************************************/
27462 /* ************************************************************************************/
27463 /* Section: Included Files */
27464 /**************************************************************************************/
27465 /**************************************************************************************/
27466 #include <stdint.h>
27467 /**************************************************************************************/
27468 /**************************************************************************************/
27469 /* Section: Data Types */
27470 /**************************************************************************************/
27471 /**************************************************************************************/
27472 /**************************************************************************************/
27473 /* APP_DATA
27474  Summary:
27475  Holds APP_DATA used for the APP tasks.
27476  Description:
27477  Holds APP_DATA used for the APP tasks. The variables
27478  used are stored here.
27479  Remarks:
27480  None
27481  */
27482 
27483 typedef
27484  struct
27485  {
27486  uint8_t RevNumber ;
27487  } APP_DATA ;
27488 
27489 extern APP_DATA
27490  APP ;
27491 /**************************************************************************************/
27492 /**************************************************************************************/
27493 /* Section: Application Initialization and State Machine Functions */
27494 /**************************************************************************************/
27495 /**************************************************************************************/
27496 /*!*************************************************************************************
27497  Function:
27498  void APP_Initialize(void)
27499  Summary:
27500  Autonomous tool application initialization routine.
27501  Description:
27502  This function initializes the application. It places the
27503  application in its initial state and prepares it to run so that its
27504  APP_Tasks function can be called.
27505  Precondition:
27506  All other system initialization routines should be called before calling
27507  this routine (in "SYS_Initialize").
27508  Parameters:
27509  None.
27510  Returns:
27511  None.
27512  Example:
27513  APP_Initialize()
27514  Remarks:
27515  This routine must be called from the main function.
27516 */
27517 
27518 void
27519  APP_Initialize ( void ) ;
27520 /*!*************************************************************************************
27521  Function:
27522  void APP_Tasks(void)
27523  Summary:
27524  Application tasks function
27525  Description:
27526  This function is the main application's tasks function. It contains the various
27527  tasks that are maintained during the operation of the shooting panel.
27528  Precondition:
27529  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27530  should be called before calling this.
27531  Parameters:
27532  None.
27533  Returns:
27534  None.
27535  Example:
27536  APP_Tasks()
27537  Remarks:
27538  This routine must be called from the main() routine.
27539  */
27540 
27541 void
27542  APP_Tasks ( void ) ;
27543  /* APP_H */
27544 /***************************************************************************************
27545  End of File
27546  */
27547 
27548 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
27549 /* CLOSE_FILE Include File */
27550 
27551 // DOM-IGNORE-BEGIN
27552 // DOM-IGNORE-END
27553 // *****************************************************************************
27554 // *****************************************************************************
27555 // Section: Type Definitions
27556 // *****************************************************************************
27557 // *****************************************************************************
27558 // *****************************************************************************
27559 /* System Objects
27560  Summary:
27561  Structure holding the system's object handles
27562  Description:
27563  This structure contains the object handles for all objects in the
27564  MPLAB Harmony project's system configuration.
27565  Remarks:
27566  These handles are returned from the "Initialize" functions for each module
27567  and must be passed into the "Tasks" function for each module.
27568 */
27569 
27570 typedef
27571  struct
27572  {
27573  SYS_MODULE_OBJ sysTmr ;
27574  SYS_MODULE_OBJ drvTmr0 ;
27575  SYS_MODULE_OBJ drvTmr1 ;
27576  SYS_MODULE_OBJ drvTmr2 ;
27577  SYS_MODULE_OBJ drvTmr3 ;
27578  SYS_MODULE_OBJ drvTmr4 ;
27579  SYS_MODULE_OBJ drvUsart0 ;
27580  SYS_MODULE_OBJ drvPMP0 ;
27581  /*** SPI Object for Index 0 ***/
27582  SYS_MODULE_OBJ spiObjectIdx0 ;
27583  /*** SPI Object for Index 1 ***/
27584  SYS_MODULE_OBJ spiObjectIdx1 ;
27585  /*** SPI Object for Index 2 ***/
27586  SYS_MODULE_OBJ spiObjectIdx2 ;
27587  SYS_MODULE_OBJ drvUSBObject ;
27588  SYS_MODULE_OBJ usbDevObject0 ;
27589  } SYSTEM_OBJECTS ;
27590 // *****************************************************************************
27591 // *****************************************************************************
27592 // Section: extern declarations
27593 // *****************************************************************************
27594 // *****************************************************************************
27595 
27596 extern SYSTEM_OBJECTS
27597  sysObj ;
27598 //DOM-IGNORE-BEGIN
27599 //DOM-IGNORE-END
27600  /* _SYS_DEFINITIONS_H */
27601 /*******************************************************************************
27602  End of File
27603 */
27604 
27605 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
27606 /* CLOSE_FILE Include File */
27607 
27608 /**************************************************************************************/
27609 /**************************************************************************************/
27610 /* Section: Data Types */
27611 /**************************************************************************************/
27612 /**************************************************************************************/
27613 /**************************************************************************************/
27614 /* HVPS_STATES
27615  Summary:
27616  HVPS_STATES enumeration
27617  Description:
27618  This enumeration defines the valid HVPS states. These states
27619  determine the behavior of the HVPS state machine at various times.
27620 */
27621 
27622 typedef
27623  enum
27624  {
27637  } HVPS_TEST_STATES ;
27638 /**************************************************************************************/
27639 /* HVPS_DATA
27640  Summary:
27641  Holds HVPS_DATA used for the HVPS tasks.
27642  Description:
27643  Holds HVPS_DATA used for the HVPS tasks. The state machine and variables
27644  used to control HVPS functions are stored here.
27645  Remarks:
27646  None
27647  */
27648 
27649 typedef
27650  struct /* This structure collects the variables and states required for these*/
27651  {
27652  /* functions to operate.*/
27653  HVPS_TEST_STATES state ;
27654  DRV_HANDLE drvSPIHandle ;
27655  DRV_SPI_BUFFER_HANDLE bufferHandle ;
27656  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
27657  bool spi_write_complete_flag ;
27658  bool spi_sent_flag ;
27659  uint16_t adj [ 1 ] ;
27660  uint16_t cont_in ;
27661  bool SWITCH ;
27662  bool new_cont_values_flag ;
27663  bool tick ;
27664  uint16_t cont_prev ;
27665  uint16_t cont_new ;
27666  uint16_t count ;
27667  bool pos_dir ;
27668  bool shutdown ;
27669  uint16_t update_rate ;
27670  uint16_t rate_time ;
27671  uint16_t update_count ;
27672  bool update_flag ;
27673  uint16_t voltage ;
27674  uint16_t current ;
27675  uint16_t sensor_offset ;
27676  uint16_t offset ;
27677  uint16_t sensor_constant ;
27678  uint16_t max_current ;
27679  uint16_t current_limit ;
27680  uint16_t upper_current_limit ;
27681  uint8_t over_current_count ;
27682  bool new_current_values_flag ;
27683  bool new_voltage_values_flag ;
27684  bool overcurrent_flag ;
27685  bool overvoltage_flag ;
27686  } HVPS_TEST_DATA ;
27687 
27688 extern HVPS_TEST_DATA
27689  HV_T_PS ;
27690 /**************************************************************************************/
27691 /**************************************************************************************/
27692 /* State Machine Functions */
27693 /**************************************************************************************/
27694 /**************************************************************************************/
27695 /*!*************************************************************************************
27696  Function:
27697  void HVPS_Test_Tasks(void)
27698  Summary:
27699  HVPS tasks function
27700  Description:
27701  This routine is the HVPS tasks function. It defines the HVPS's state machine and
27702  core logic.
27703  Precondition:
27704  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27705  should be called before calling this.
27706  Parameters:
27707  None.
27708  Returns:
27709  None.
27710  Example:
27711  HVPS_Tasks()
27712 
27713  Remarks:
27714  This routine must be called from APP_Tasks() routine.
27715  */
27716 
27717 void
27718  HVPS_Test_Tasks ( void ) ;
27719  /* Provide C++ Compatibility */
27720  /* HVPS_TEST_H */
27721 /***************************************************************************************
27722  End of File
27723  */
27724 
27725 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps_test.h*/
27726 /* CLOSE_FILE Include File */
27727 
27728 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h */
27729 /**************************************************************************************/
27743 /**************************************************************************************/
27744 #ifndef ADC_H /* Guard against multiple inclusion.*/
27745 #define ADC_H
27746 /**************************************************************************************/
27747 /**************************************************************************************/
27748 /* Section: Included Files */
27749 /**************************************************************************************/
27750 /**************************************************************************************/
27751 #include <stdint.h>
27752 #include <stdbool.h>
27753 /**************************************************************************************/
27754 /**************************************************************************************/
27755 /* Section: Data Types */
27756 /**************************************************************************************/
27757 /**************************************************************************************/
27758 /**************************************************************************************/
27759 /* ADC states
27760  Summary:
27761  ADC states enumeration
27762  Description:
27763  This enumeration defines the valid ADC states. These states
27764  determine the behavior of the ADC state machine at various times.
27765 */
27766 
27767 typedef
27768  enum
27769  {
27774  } ADC_STATES ;
27775 /**************************************************************************************/
27776 /* ADC_DATA
27777  Summary:
27778  Holds ADC_DATA used for the ADC tasks.
27779  Description:
27780  Holds ADC_DATA used for the ADC tasks. The state machine and variables
27781  used to control ADC functions are stored here.
27782  Remarks:
27783  None
27784  */
27785 
27786 typedef
27787  struct /* This structure collects the variables and states required for these*/
27788  {
27789  /* functions to operate.*/
27790  ADC_STATES state ;
27791  uint16_t hvps_i ;
27792  uint16_t hvps_cont ;
27793  uint16_t wl_cps_i ;
27794  uint16_t wl_cps_v ;
27795  uint16_t wl_sps_i_cf ;
27796  uint16_t wl_sps_i ;
27797  bool tick ;
27798  bool ADCInt ;
27799  } ADC_DATA ;
27800 
27801 extern ADC_DATA
27802  ADC ;
27803 /**************************************************************************************/
27804 /**************************************************************************************/
27805 /* State Machine Functions */
27806 /**************************************************************************************/
27807 /**************************************************************************************/
27808 /*!*************************************************************************************
27809  Function:
27810  void ADC_Tasks(void)
27811  Summary:
27812  ADC tasks function
27813  Description:
27814  This routine is the ADC tasks function. It defines the ADC's state machine and
27815  core logic. This machine initializes the Timer and ADCs used to digitize signal
27816  inputs. Once the timer and ADCs are started, this machine is set to idle and the
27817  the updated ADC values are retrieved in the system interrupt routine.
27818  Precondition:
27819  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27820  should be called before calling this.
27821  Parameters:
27822  None.
27823  Returns:
27824  None.
27825  Example:
27826  ADC_Tasks()
27827 
27828  Remarks:
27829  This routine must be called from the APP_Tasks() routine.
27830  */
27831 
27832 void
27833  ADC_Tasks ( void ) ;
27834  /* ADC_H */
27835 /***************************************************************************************
27836  End of File
27837  */
27838 
27839 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h*/
27840 /* CLOSE_FILE Include File */
27841 
27842 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h */
27843 /**************************************************************************************/
27857 /**************************************************************************************/
27858 #ifndef MAN_H /* Guard against multiple inclusion.*/
27859 #define MAN_H
27860 /**************************************************************************************/
27861 /**************************************************************************************/
27862 /* Section: Included Files */
27863 /**************************************************************************************/
27864 /**************************************************************************************/
27865 #include <stdbool.h>
27866 #include "../system_config.h"
27867 #include "../system_definitions.h"
27868 /**************************************************************************************/
27869 /**************************************************************************************/
27870 /* Section: Defines */
27871 /**************************************************************************************/
27872 /**************************************************************************************/
27873 /* Define the upper and lower bounds for Manchester data, TMR4 tick = 200nsec * 8 = 1.6usec */
27874 /* Define the upper and lower bounds for Manchester data, TMR2 tick = 10nS * 16 = 160nS. */
27875 //#define ManHalfUpper 1171 /* 1.8736 mS.*/
27876 //#define ManHalfLower 500 /* 0.8 mS.*/
27877 //#define ManFullUpper 1953 /* 3.12148 mS.*/
27878 //#define ManFullLower 1172 /* 1.8752 mS.*/
27879 //#define ManHalfUpper 6400 /* 1.8736 mS.?*/ /* time div = 32*/
27880 //#define ManHalfLower 1000 /* 0.8 mS.?*/
27881 //#define ManFullUpper 10000 /* 3.12148 mS.?*/
27882 //#define ManFullLower 6401 /* 1.8752 mS.?*/
27883 #define ManHalfUpper 11800U
27884 #define ManHalfLower 2000U
27885 #define ManFullUpper 20000U
27886 #define ManFullLower 11801U
27887 #define NoManBits 32U
27888 #define HalfBit 0x12U
27889 #define FullBit 0x10U
27890 #define SizeOfBiasLUT 48U
27891 /**************************************************************************************/
27892 /**************************************************************************************/
27893 /* Section: Data Types */
27894 /**************************************************************************************/
27895 /**************************************************************************************/
27896 
27897 typedef
27898 float
27900 /**************************************************************************************/
27901 /* MAN states
27902  Summary:
27903  MAN states enumeration
27904  Description:
27905  This enumeration defines the valid MAN states. These states determine the
27906  behavior of the MAN state machine at various times. This machine controls when
27907  the MAN_RX and MAN_PROCESS machines execute their states.
27908 */
27909 
27910 typedef
27911  enum
27912  {
27919  } MAN_STATES ;
27920 /**************************************************************************************/
27921 /* MAN_RX_STATES
27922  Summary:
27923  MAN_RX_STATES enumeration
27924  Description:
27925  This enumeration defines the valid MAN_RX_STATES. These states determine the
27926  behavior of the MAN_RX_STATES machine at various times. This machine receives
27927  the data from a PerfSwtich.
27928 */
27929 
27930 typedef
27931  enum
27932  {
27936  } MAN_RX_STATES ;
27937 /**************************************************************************************/
27938 /* MAN_PROCESS_STATES
27939  Summary:
27940  MAN_PROCESS_STATES enumeration
27941  Description:
27942  This enumeration defines the valid MAN_PROCESS_STATES. These states
27943  determine the behavior of the MAN_PROCESS_STATES machine at various times.
27944 */
27945 
27946 typedef
27947  enum
27948  {
27952  } MAN_PROCESS_STATES ;
27953 /**************************************************************************************/
27954 /* MAN_DATA
27955  Summary:
27956  Holds MAN_DATA used for the Manchester tasks.
27957  Description:
27958  Holds MAN_DATA used for the Manchester tasks. The state machines and variables
27959  used to control Manchester functions are stored here.
27960  Remarks:
27961  None
27962  */
27963 
27964 typedef
27965  struct
27966  {
27967  MAN_STATES state ;
27968  MAN_RX_STATES Rx_state ;
27969  MAN_PROCESS_STATES Process_state ;
27970  uint16_t preamble [ 5 ] ;
27971  uint16_t time [ 96 ] ;
27972  uint8_t level [ 96 ] ;
27973  uint8_t ans [ 32U + 2 ] ;
27974  uint8_t msg [ 4 ] ;
27975  uint8_t cnt_preamble ;
27976  uint8_t trynumber ;
27977  bool process_complete_flag ;
27978  bool spi_write_complete_flag ;
27979  bool spi_sent_flag ;
27980  uint8_t timer_count ;
27981  uint8_t timer_complete ;
27982  bool tick ;
27983  bool bad_crc ;
27984  bool error ;
27985  bool manual_bias_flag ;
27986  uint8_t crc ;
27987  } MAN_DATA ;
27988 
27989 extern MAN_DATA
27990  MAN ;
27991 /**************************************************************************************/
27992 /* MAN_BIAS_DATA
27993  Summary:
27994  Holds MAN_BIAS_DATA
27995  Description:
27996  This structure holds the MAN_BIAS_DATA. It is used to adjust the bias value of
27997  the Manchester DAC.
27998  Remarks:
27999  None
28000  */
28001 
28002 typedef
28003  struct
28004  {
28005  DRV_HANDLE spi_bias_fsk ;
28006  DRV_SPI_BUFFER_HANDLE bufferHandle ;
28007  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
28008  uint16_t adj [ 1 ] ;
28009  uint16_t dac_a_setting ;
28010  uint16_t dac_b_setting ;
28011  float32_t hi_current ;
28012  float32_t lo_current ;
28013  float32_t lo_volts ;
28014  float32_t hi_volts ;
28015  float32_t slope ;
28016  float32_t offset ;
28017  uint8_t index ;
28018  } MAN_BIAS_DATA ;
28019 
28020 extern MAN_BIAS_DATA
28021  MAN_BIAS ;
28022 /**************************************************************************************/
28023 /**************************************************************************************/
28024 /* Local Functions */
28025 /**************************************************************************************/
28026 /**************************************************************************************/
28027 /*!*************************************************************************************
28028  Function:
28029  static void Init_Manchester( void )
28030  Summary:
28031  Function to initialize the Manchester parameters.
28032  Description:
28033  Function to initialize the Manchester parameters.
28034 
28035  Precondition:
28036  None.
28037  Parameters:
28038  None.
28039  Returns:
28040  None.
28041 
28042  Remarks:
28043  None.
28044 
28045  Example:
28046  Init_Manchester()
28047  */
28048 
28049 static void
28050  Init_Manchester ( void ) ;
28051 /*!*************************************************************************************
28052  Function:
28053  static bool Check_Manchester( void )
28054  Summary:
28055  This routine checks for valid Manchester response.
28056  Description:
28057  This routine checks for valid Manchester response. The first two bytes are
28058  checked. If both are zero, then we did not receive a valid response. This is
28059  used in the function Test_Manchester.
28060 
28061  Precondition:
28062  None.
28063  Parameters:
28064  None.
28065  Returns:
28066  bool ans
28067 
28068  Remarks:
28069  None.
28070 
28071  Example:
28072  if( Check_Manchester( ) == true )
28073  */
28074 
28075 static bool
28076  Check_Manchester ( void ) ;
28077 /*!*************************************************************************************
28078  Function:
28079  static void Decode_Manchester( void )
28080  Summary:
28081  Function to decode the Manchester response from a PerfSwitch.
28082  Description:
28083  Function to decode the Manchester response from a PerfSwitch. The MAN.level
28084  and MAN.time arrays are used to generate the MAN.ANS array.
28085  MAN.level[] - level of the incoming data.
28086  MAN.time[] - time of corresponding wave timer ticks.
28087 
28088  The last 1 of the preamble is always in the data so we have a fixed starting point.
28089 
28090  Precondition:
28091  None.
28092  Parameters:
28093  None.
28094  Returns:
28095  None.
28096 
28097  Remarks:
28098  None.
28099 
28100  Example:
28101  Decode_Manchester()
28102  */
28103 
28104 static void
28105  Decode_Manchester ( void ) ;
28106 /*!*************************************************************************************
28107  Function:
28108  static void Package_Manchester( void )
28109  Summary:
28110  Function to prepare Manchester response for further processing.
28111  Description:
28112  Function to prepare Manchester response for further processing. The Manchester
28113  response is decoded and the 1 X 32 answer array is packed into a 4 X 8 bit
28114  message array.
28115 
28116  Precondition:
28117  None.
28118  Parameters:
28119  None.
28120  Returns:
28121  None.
28122 
28123  Remarks:
28124  None.
28125 
28126  Example:
28127  Package_Manchester()
28128  */
28129 
28130 static void
28131  Package_Manchester ( void ) ;
28132 /*!*************************************************************************************
28133  Function:
28134  static void Test_Manchester (void)
28135  Summary:
28136  Function to test the returned Manchester message.
28137  Description:
28138  Function to test the returned Manchester message. The first two bytes are checked
28139  to make sure they are not both 0. If they are not, the FSK frequencies are
28140  adjusted, and the CRC is checked. If the CRC is a match, then a response message
28141  to the host is prepared. Otherwise, up to two different FSK frequencies are
28142  tried in order to establish communications with a PerfSwitch.
28143 
28144  Precondition:
28145  None.
28146  Parameters:
28147  None.
28148  Returns:
28149  None.
28150 
28151  Remarks:
28152  None.
28153 
28154  Example:
28155  Test_Manchester ()
28156  */
28157 
28158 static void
28159  Test_Manchester ( void ) ;
28160 /*!*************************************************************************************
28161  Function:
28162  static void Flush_Buffer_Manchester( void )
28163  Summary:
28164  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
28165  Description:
28166  Function to reset MAN.level[], MAN.time[], MAN.msg[] and MAN.preamble[] buffers.
28167  These are flushed after every reception.
28168 
28169  Precondition:
28170  None.
28171  Parameters:
28172  None.
28173  Returns:
28174  None.
28175 
28176  Remarks:
28177  None.
28178 
28179  Example:
28180  Flush_Buffer_Manchester()
28181  */
28182 
28183 static void
28184  Flush_Buffer_Manchester ( void ) ;
28185 /*!*************************************************************************************
28186  Function:
28187  static float32_t Calc_Fsk_Scaling( void )
28188  Summary:
28189  Function to calculate the amount of FSK adjustment needed based on the preamble bit
28190  timer counts.
28191  Description:
28192  Function to calculate the amount of FSK adjustment needed based on the preamble bit
28193  timer counts. The average of the timer counts is used to determine the amount
28194  of adjustment. The result is a multiplier used in the Generate_Sine_Wave _Data
28195  function to change the amount of time between the FSK DAC updates. Adjustments
28196  up to 10% have been seen in temperature testing. Adjustments are generally
28197  greater than 1 when a PerfSwitch is hot and less than 1 when a PerfSwitch is cold.
28198 
28199  Precondition:
28200  None.
28201  Parameters:
28202  None.
28203  Returns:
28204  None.
28205 
28206  Remarks:
28207  None.
28208 
28209  Example:
28210  CalcFskScaling( )
28211  */
28212 
28213 static float32_t
28214  Calc_Fsk_Scaling ( void ) ;
28215 /**************************************************************************************/
28216 /**************************************************************************************/
28217 /* Interface Functions */
28218 /**************************************************************************************/
28219 /**************************************************************************************/
28220 /*!*************************************************************************************
28221  Function:
28222  void Calc_Auto_Bias(void)
28223  Summary:
28224  Function to calculate the amount of bias adjust required and to transmit that
28225  result via a SPI port to the Manchester bias DAC.
28226  Description:
28227  Function to calculate the amount of bias adjust required and to transmit that
28228  result via a SPI port to the Manchester bias DAC.
28229 
28230  Precondition:
28231  None.
28232  Parameters:
28233  None.
28234  Returns:
28235  None.
28236 
28237  Remarks:
28238  None.
28239 
28240  Example:
28241  CalcAutoBias()
28242  */
28243 
28244 void
28245  Calc_Auto_Bias ( void ) ;
28246 /*!*************************************************************************************
28247  Function:
28248  void Set_Bias(uint8_t value)
28249  Summary:
28250  Function to transmit the bias adjust value via an SPI port to the Manchester
28251  bias DAC.
28252  Description:
28253  Function to transmit the bias adjust value via an SPI port to the Manchester
28254  bias DAC. Value is integer between 0 and 47. Values greater than 47 are set to 47.
28255 
28256  Precondition:
28257  None.
28258  Parameters:
28259  uint8_t value
28260  Returns:
28261  None.
28262 
28263  Remarks:
28264  None.
28265 
28266  Example:
28267  Set_Bias(uint8_t value)
28268  */
28269 
28270 void
28271  Set_Bias (
28272  uint8_t value ) ;
28273 /**************************************************************************************/
28274 /**************************************************************************************/
28275 /* State Machine Functions */
28276 /**************************************************************************************/
28277 /**************************************************************************************/
28278 /*!*************************************************************************************
28279  Function:
28280  void MAN_Tasks(void)
28281  Summary:
28282  MAN tasks function
28283  Description:
28284  This routine is the MAN tasks function. It defines the MAN's state machine and
28285  core logic. This machine controls the MAN operation and sets flags indicating
28286  new values are available from the system interrupt routine for use in other parts
28287  of the application. It also controls when the MAN_Process_Tasks machine and
28288  MAN_RX_Tasks machines operate.
28289  Precondition:
28290  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28291  should be called before calling this.
28292  Parameters:
28293  None.
28294  Returns:
28295  None.
28296  Example:
28297  MAN_Tasks()
28298 
28299  Remarks:
28300  This routine must be called from the APP_Tasks() routine.
28301  */
28302 
28303 void
28304  MAN_Tasks ( void ) ;
28305 /*!*************************************************************************************
28306  Function:
28307  static void MAN_PROCESS_Tasks(void)
28308  Summary:
28309  MAN_PROCESS tasks function
28310  Description:
28311  This routine is the MAN_PROCESS tasks function. It defines the MAN_PROCESS's
28312  state machine and core logic. This machine controls the MAN_Process operation. It
28313  decodes, packages, tests and prepares for another message to process.
28314 
28315  During packaging, the 32 bit Manchester response is packaged into a 4 byte array.
28316 
28317  During testing, the CRC is checked and the appropriate response is prepared to
28318  send to the host. If a bad response was received, the FSK frequencies are adjusted
28319  and two more attempts are made to retrieve a valid response.
28320 
28321  Precondition:
28322  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28323  should be called before calling this.
28324  Parameters:
28325  None.
28326  Returns:
28327  None.
28328  Example:
28329  MAN_PROCESS_Tasks()
28330 
28331  Remarks:
28332  This routine must be called from the MAN_Tasks() routine.
28333  */
28334 
28335 static void
28336  MAN_PROCESS_Tasks ( void ) ;
28337 /*!*************************************************************************************
28338  Function:
28339  void MAN_RX_Tasks(void)
28340  Summary:
28341  MAN_Rx tasks function
28342  Description:
28343  This routine is the MAN_Rx tasks function. It defines the MAN_Rx's
28344  state machine and core logic. It determines if a proper message preamble has
28345  been received and determines the time and input level state when a transition
28346  occurs. This routine is called when there is a high to low change on the port pin.
28347 
28348  The state MAN_RX_STATE_IDLE has no effect on Manchester processing.
28349  The state MAN_RX_STATE_PREAMBLE is responsible for syncing up to a 1111.
28350  The state MAN_RX_STATE_DATA receives the data. The time ranges allow for variances
28351  between PerfSwitches and how they perform over temperature.
28352 
28353  Precondition:
28354  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28355  should be called before calling this.
28356  Parameters:
28357  None.
28358  Returns:
28359  None.
28360  Example:
28361  MAN_RX_Tasks()
28362 
28363  Remarks:
28364  This routine must be called from the MAN_Tasks() routine.
28365  */
28366 
28367 void
28368  MAN_RX_Tasks ( void ) ;
28369  /* MAN_H */
28370 /***************************************************************************************
28371  End of File
28372  */
28373 
28374 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\man.h*/
28375 /* CLOSE_FILE Include File */
28376 
28377 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h */
28378 /**************************************************************************************/
28394 /**************************************************************************************/
28395 #ifndef WL_SPS_H /* Guard against multiple inclusion */
28396 #define WL_SPS_H
28397 /**************************************************************************************/
28398 /**************************************************************************************/
28399 /* Section: Included Files */
28400 /**************************************************************************************/
28401 /**************************************************************************************/
28402 #include "../system_config.h"
28403 #include "../system_definitions.h"
28404 #include <stdbool.h>
28405 /**************************************************************************************/
28406 /**************************************************************************************/
28407 /* Section: Defines */
28408 /**************************************************************************************/
28409 /**************************************************************************************/
28410  /* A brief description of a section can be given directly below the section
28411  banner.
28412  */
28413 #define NEGATIVE_OFFSET 0x02U
28414 #define POS_HIGH_OFFSET 0x01U
28415 #define POS_LOW_OFFSET 0x03U
28416 #define DEFAULT_OFFSET 0x04U
28417 #define I_ARRAY_SIZE 50U
28418 
28419 typedef
28420 float
28421  float32_t ;
28422 /**************************************************************************************/
28423 /**************************************************************************************/
28424 /* Section: Data Types */
28425 /**************************************************************************************/
28426 /**************************************************************************************/
28427 /**************************************************************************************/
28428 /* WL_SPS_STATES
28429  Summary:
28430  WL_SPS_STATES enumeration
28431  Description:
28432  This enumeration defines the valid WL_SPS states. These states
28433  determine the behavior of the WL_SPS state machine at various times.
28434 */
28435 
28436 typedef
28437  enum
28438  {
28446  } WL_SPS_STATES ;
28447 /**************************************************************************************/
28448 /* WL_SPS_DATA
28449  Summary:
28450  Holds WL_SPS_DATA used for the WL_SPS tasks.
28451  Description:
28452  Holds WL_SPS_DATA used for the WL_SPS tasks. The state machine and variables
28453  used to control WL_SPS functions are stored here.
28454  Remarks:
28455  None
28456  */
28457 
28458 typedef
28459  struct
28460  {
28461  WL_SPS_STATES state ;
28462  DRV_HANDLE drvICHandle ;
28463  uint16_t voltage ;
28464  uint16_t voltage_limit ;
28465  uint16_t upper_voltage_limit ;
28466  uint16_t volt_count ;
28467  uint16_t current ;
28468  uint16_t max_current ;
28469  uint16_t current_limit ;
28470  uint16_t upper_current_limit ;
28471  uint8_t over_current_count ;
28472  uint8_t array_sum_count ;
28473  uint8_t array_count ;
28474  uint16_t offset ;
28475  int16_t i_array [ 50U ] ;
28476  int16_t i_sum ;
28477  bool new_current_values_flag ;
28478  bool new_voltage_values_flag ;
28479  bool overcurrent_flag ;
28480  bool overvoltage_flag ;
28481  uint16_t sensor_offset ;
28482  uint16_t sensor_constant ;
28483  bool sensor_offset_tick ;
28484  uint16_t v_array [ 50 ] ;
28485  uint16_t v_array_count ;
28486  uint32_t v_sum ;
28487  float32_t v_avg ;
28488  bool tick ;
28489  uint8_t no_count ;
28490  bool array_full ;
28491  uint8_t overvoltage_count ;
28492  } WL_SPS_DATA ;
28493 
28494 extern WL_SPS_DATA
28495  WL_SPS ;
28496 /**************************************************************************************/
28497 /**************************************************************************************/
28498 /* Section: Interface Functions */
28499 /**************************************************************************************/
28500 /**************************************************************************************/
28501 /*!*************************************************************************************
28502  Function:
28503  void SET_WL_SPS_IOffset( uint8_t mode )
28504  Summary:
28505  This function sets the wire-line current offset based on external settings.
28506  Description:
28507  This function sets the wire-line current offset based on external settings.
28508 
28509  Precondition:
28510  None.
28511  Parameters:
28512  None.
28513  Returns
28514  None.
28515 
28516  Remarks:
28517  None.
28518 
28519  Example:
28520  SET_WL_SPS_IOffset( uint8_t mode )
28521  */
28522 
28523 void
28525  uint8_t mode ) ;
28526 /*!*************************************************************************************
28527  Function:
28528  void Set_WL_SPS_CurrentLimit(uint16_t value)
28529  Summary:
28530  This function sets the current limit for the wire-line shooting power
28531  supply (WL_SPS).
28532  Description:
28533  This function sets the current limit for the wire-line shooting power
28534  supply (WL_SPS) and ensures it it not greater than the upper current limit.
28535  If the value programmed is greater than the upper current limit, then the the
28536  current limit is set to the upper current limit value.
28537  This is used in the WL_SPS over current check.
28538 
28539  Precondition:
28540  None.
28541  Parameters:
28542  None.
28543  Returns
28544  None.
28545 
28546  Remarks:
28547  None.
28548 
28549  Example:
28550  Set_WL_SPS_CurrentLimit(uint16_t value)
28551  */
28552 
28553 void
28555  uint16_t value ) ;
28556 /**************************************************************************************/
28557 /**************************************************************************************/
28558 /* State Machine Functions */
28559 /**************************************************************************************/
28560 /**************************************************************************************/
28561 /*!*************************************************************************************
28562  Function:
28563  *
28564  void WL_SPS_Tasks(void)
28565  Summary:
28566  WL_SPS_Tasks function
28567  Description:
28568  This routine is the WL_SPS_Tasks function. It defines the WL_SPS_Tasks state
28569  machine and core logic. This machine is used to monitor the wire-line shooting
28570  power supply (WL_SPS) voltage and current and will set flags when those limits
28571  are exceeded. Those flags are monitored by the HV_PS machine and will turn the
28572  supply off if either of those flags are set.
28573  Precondition:
28574  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28575  should be called before calling this.
28576  Parameters:
28577  None.
28578  Returns:
28579  None.
28580  Remarks:
28581  This routine must be called from the APP_Tasks() routine.
28582  Example:
28583  WL_SPS_Tasks()
28584  */
28585 
28586 void
28587  WL_SPS_Tasks ( void ) ;
28588  /* WL_SPS_H */
28589 /***************************************************************************************
28590  End of File
28591  */
28592 
28593 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h*/
28594 /* CLOSE_FILE Include File */
28595 
28596 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps.h */
28597 //**************************************************************************************/
28611 /**************************************************************************************/
28612 #ifndef HVPS_H /* Guard against multiple inclusion.*/
28613 #define HVPS_H
28614 /**************************************************************************************/
28615 /**************************************************************************************/
28616 /* Section: Included Files */
28617 /**************************************************************************************/
28618 /**************************************************************************************/
28619 #include "../system_definitions.h"
28620 /**************************************************************************************/
28621 /**************************************************************************************/
28622 /* Section: Data Types */
28623 /**************************************************************************************/
28624 /**************************************************************************************/
28625 /**************************************************************************************/
28626 /* HVPS_STATES
28627  Summary:
28628  HVPS_STATES enumeration
28629  Description:
28630  This enumeration defines the valid HVPS states. These states
28631  determine the behavior of the HVPS state machine at various times.
28632 */
28633 
28634 typedef
28635  enum
28636  {
28649  } HVPS_STATES ;
28650 /**************************************************************************************/
28651 /* HVPS_DATA
28652  Summary:
28653  Holds HVPS_DATA used for the HVPS tasks.
28654  Description:
28655  Holds HVPS_DATA used for the HVPS tasks. The state machine and variables
28656  used to control HVPS functions are stored here.
28657  Remarks:
28658  None
28659  */
28660 
28661 typedef
28662  struct /* This structure collects the variables and states required for these*/
28663  {
28664  /* functions to operate.*/
28665  HVPS_STATES state ;
28666  DRV_HANDLE drvSPIHandle ;
28667  DRV_SPI_BUFFER_HANDLE bufferHandle ;
28668  DRV_SPI_BUFFER_HANDLE bufferHandle2 ;
28669  bool spi_write_complete_flag ;
28670  bool spi_sent_flag ;
28671  uint16_t adj [ 1 ] ;
28672  uint16_t cont_in ;
28673  bool pot_switch ;
28674  bool new_cont_values_flag ;
28675  bool tick ;
28676  uint16_t cont_prev ;
28677  uint16_t cont_new ;
28678  uint16_t count ;
28679  bool pos_dir ;
28680  bool shutdown ;
28681  uint16_t update_rate ;
28682  uint16_t rate_time ;
28683  uint16_t update_count ;
28684  bool update_flag ;
28685  uint16_t voltage ;
28686  uint16_t current ;
28687  uint16_t sensor_offset ;
28688  uint16_t offset ;
28689  uint16_t sensor_constant ;
28690  uint16_t max_current ;
28691  uint16_t current_limit ;
28692  uint16_t upper_current_limit ;
28693  uint8_t over_current_count ;
28694  bool new_current_values_flag ;
28695  bool new_voltage_values_flag ;
28696  bool overcurrent_flag ;
28697  bool overvoltage_flag ;
28698  } HVPS_DATA ;
28699 
28700 extern HVPS_DATA
28701  HV_PS ;
28702 /**************************************************************************************/
28703 /**************************************************************************************/
28704 /* Section: Interface Functions */
28705 /**************************************************************************************/
28706 /**************************************************************************************/
28707 /*!*************************************************************************************
28708  Function:
28709  void Set_HVPS_Ramp_Rate( uint16_t value )
28710  Summary:
28711  This function sets update rate for the HVPS control voltage.
28712  Description:
28713  This function sets update rate for the HVPS control voltage. Value is a rate in
28714  volts/second. This value is then converted to an update rate for the control DAC.
28715  For example, an update value of 100V/second gives an DAC update rate of approx.
28716  20mS. This update rate is used with Timer 1 to control when the control DAC is
28717  updated.
28718 
28719  Precondition:
28720  None.
28721  Parameters:
28722  uint16_t value: Value representing volts/second.
28723  Returns
28724  None.
28725 
28726  Remarks:
28727  None.
28728 
28729  Example:
28730  SET_WL_SPS_IOffset( unsigned char mode )
28731  */
28732 
28733 void
28735  uint16_t value ) ;
28736 /**************************************************************************************/
28737 /**************************************************************************************/
28738 /* State Machine Functions */
28739 /**************************************************************************************/
28740 /**************************************************************************************/
28741 /*!*************************************************************************************
28742  Function:
28743  void HVPS_Tasks(void)
28744  Summary:
28745  HVPS tasks function
28746  Description:
28747  This routine is the HVPS tasks function. It defines the HVPS's state machine and
28748  core logic.
28749  Precondition:
28750  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28751  should be called before calling this.
28752  Parameters:
28753  None.
28754  Returns:
28755  None.
28756  Example:
28757  HVPS_Tasks()
28758 
28759  Remarks:
28760  This routine must be called from APP_Tasks() routine.
28761  */
28762 
28763 void
28764  HVPS_Tasks ( void ) ;
28765  /* HVPS_H */
28766 /***************************************************************************************
28767  End of File
28768  */
28769 
28770 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\hvps.h*/
28771 /* CLOSE_FILE Include File */
28772 
28773 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h */
28774 /**************************************************************************************/
28791 /**************************************************************************************/
28792 #ifndef STATUSST_H /* Guard against multiple inclusion */
28793 #define STATUSST_H
28794 /**************************************************************************************/
28795 /**************************************************************************************/
28796 /* Section: Included Files */
28797 /**************************************************************************************/
28798 /**************************************************************************************/
28799 #include <stdbool.h>
28800 #include <stdint.h>
28801 /*typedef unsigned char uchar8_t*/
28802 /**************************************************************************************/
28803 /**************************************************************************************/
28804 /* Section: Interface Functions */
28805 /**************************************************************************************/
28806 /**************************************************************************************/
28807 /*!*************************************************************************************
28808  Function:
28809  void Set_Status(uint8_t bitposn)
28810  Summary:
28811  This function sets the desired bit to a one in the PIB status register.
28812  Description:
28813  This function sets the desired bit to a one in the PIB status register. This is
28814  called by various functions to indicate a command result or switch setting.
28815 
28816  Precondition:
28817  None.
28818  Parameters:
28819  uint8_t bitposn - the desired bit position in the PIB status register.
28820  Returns
28821  None.
28822 
28823  Remarks:
28824  None.
28825 
28826  Example:
28827  Set_Status(6)
28828  */
28829 
28830 void
28831  Set_Status (
28832  uint8_t bitposn ) ;
28833 /*!*************************************************************************************
28834  Function:
28835  void Clear_Status(unsigned short bitposn)
28836  Summary:
28837  This function sets the desired bit to a zero in the PIB status register.
28838  Description:
28839  This function sets the desired bit to a zero in the PIB status register. This is
28840  called by various functions to indicate a command result or switch setting.
28841 
28842  Precondition:
28843  None.
28844  Parameters:
28845  uint8_t bitposn - the desired bit position in the PIB status register.
28846  Returns
28847  None.
28848 
28849  Remarks:
28850  None.
28851 
28852  Example:
28853  ClearStatus(7)
28854  */
28855 
28856 void
28857  Clear_Status (
28858  uint8_t bitposn ) ;
28859 /*!*************************************************************************************
28860  Function:
28861  void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1 )
28862  Summary:
28863  Function to prepare the protocol A response.
28864  Description:
28865  Function to prepare the protocol A response. The return message is seven bytes.
28866  the first byte is the command that was sent. the next two bytes are the PIB status
28867  register. The next three bytes can contain two - 12 bit data fields. The data is
28868  then transferred to the TxFifo. The CRC for the return message is calculated
28869  and placed in the last byte.
28870 
28871  Precondition:
28872  None.
28873  Parameters:
28874  uint8_t byte - The command byte.
28875  uint16_t data2 - a 12 bit data field.
28876  uint16_t data1 - 1 12 bit data field.
28877  Returns
28878  None.
28879 
28880  Remarks:
28881  None.
28882 
28883  Example:
28884  Prepare_Return_A(CMD.COMMAND[ 0 ], 0, 0)
28885  */
28886 
28887 void
28889  uint8_t byte ,
28890  uint16_t data2 ,
28891  uint16_t data1 ) ;
28892 /*!*************************************************************************************
28893  Function:
28894  void Prepare_Return_B(uint8_t byt[] )
28895  Summary:
28896  Function to prepare the protocol B response.
28897  Description:
28898  Function to prepare the protocol B response. The return message is seven bytes.
28899  the first byte is the command that was sent. the next two bytes are the PIB status
28900  register. The next three bytes can contain a 12 bit Switch status register,
28901  a four bit StateID and an 8 bit Switch ID. The data is then transferred to the
28902  TxFifo. The CRC for the return message is calculated and placed in the last byte.
28903 
28904  Precondition:
28905  None.
28906  Parameters:
28907  uint8_t byt[] - Three received bytes from a PerfSwitch.
28908  Returns
28909  None.
28910 
28911  Remarks:
28912  None.
28913 
28914  Example:
28915  Prepare_Return_B( MAN.msg )
28916  */
28917 
28918 void
28920  uint8_t byt [] ) ;
28921  /* STATUSST_H */
28922 /***************************************************************************************
28923  End of File
28924  */
28925 
28926 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h*/
28927 /* CLOSE_FILE Include File */
28928 
28929 /**************************************************************************************/
28930 /**************************************************************************************/
28931 /* Section: Structure Data and Local Variables */
28932 /**************************************************************************************/
28933 /**************************************************************************************/
28934 /* HV_T_PS Data
28935  Summary:
28936  These structures hold required data.
28937  Description:
28938  These structures hold required data. These are here to link these
28939  structures for use by the local functions.
28940 
28941  Remarks:
28942  These are defined in hvps_test.h
28943 */
28944 
28947 
28948 static HVPS_TEST_STATES
28950 /**************************************************************************************/
28951 /**************************************************************************************/
28952 /* Section: SPI Callback Functions */
28953 /**************************************************************************************/
28954 /**************************************************************************************/
28955 
28956 void
28958  DRV_SPI_BUFFER_EVENT event ,
28959  DRV_SPI_BUFFER_HANDLE bufferHandle ,
28960  void * context )
28961  {
28962  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
28963  if
28964  (
28966  )
28967  {
28968  ((int)(bitmapstruct.element1 |= (1 << 29))); /* 1 */
28969  {
28971  }
28972  } else ((int)(bitmapstruct.element1 |= (1 << 30))); /* 4 */
28973  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 30 */
28974  hvps_test_67zqendz ( 64 ) ; /* 30 */
28975  }
28976 /**************************************************************************************/
28977 /**************************************************************************************/
28978 /* Section: State Machine Functions */
28979 /**************************************************************************************/
28980 /**************************************************************************************/
28981 /***************************************************************************************
28982  Function:
28983  void HVPS_Test_Tasks ( void )
28984  Summary:
28985  This routine is the HVPS_tasks function. It defines the (HV_T_PS) state machine and
28986  core logic.
28987  Remarks:
28988  Refer to the hvps_test.h interface header for function usage details.
28989  */
28990 
28991 void
28993  {
28994  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 0))); /* 37 */
28995  switch (
28996  ( ( int )( /* 29 */
28997  HV_T_PS.state
28998  ))*
28999  ((bitmapstruct.element2 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ) /* 19 */
29000  )
29001  {
29002  case HVPS_TEST_STATE_INIT :
29003  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 2) : 0)), 1 ); /* 41 */
29004  /* Initialize values.*/
29005  {
29006 // HV_PS.new_cont_values_flag = false; /* New ADC control pot values are not available.*/
29007 // HV_PS.cont_prev = 0; /* The previous control voltage count.*/
29008 // HV_PS.cont_new = 0; /* The new control voltage count.*/
29009 // HV_PS.pos_dir = true; /* Set true if the new count is greater than the previous count.*/
29010 // HV_PS.count = 0; /* The difference between the new and previous counts.*/
29011 // HV_PS.tick = false; /* Timer tick used to regulate when the control DAC is updated.*/
29012 // HV_PS.drvSPIHandle = DRV_HANDLE_INVALID; /* Set the HV_PS SPI Port handle to invalid.*/
29013 // HV_PS.spi_write_complete_flag = false; /* Set to false when the SPI operation is not complete.*/
29014 // HV_PS.spi_sent_flag = false;
29015 // HV_PS.shutdown = false; /* Set to true if the HVPS shuts down.*/
29017  /* Move on to open the SPI port.*/
29018 // HV_PS.update_rate = 20; /* DAC control voltage incremented every 20mS.*/
29019 // HV_PS.update_count = 0; /* Initialize update counter.*/
29020 // HV_PS.update_flag = false; /* Initialize flag to update control DAC.*/
29021 //
29022 // HV_PS.sensor_constant = (uint16_t)((3.3/4096) * (1.3243/0.066) *1000); /* Convert ADC reading to mA current. Convert to integer causes @ 1% error.(16).*/
29023 // HV_PS.current_limit = 60; /* Set the initial current limit to 60mA.*/
29024 // HV_PS.max_current = 0;
29025 // HV_PS.offset = 0;
29026  }
29027  ((int)(bitmapstruct.element2 |= (1 << 3))); /* 16 */
29028  goto l129047 ;
29030  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 4) : 0)), 1 ); /* 41 */
29031  {
29032 // if(HV_PS.new_current_values_flag == true) /* If a new value is available,*/
29033 // {
29034 // HV_PS.sensor_offset = ADC.hvpsi; /* First reading is the zero current sensor offset.*/
29035 // HV_PS.state = HVPS_STATE_INIT_SPI; /* Move on to read the WL_SPS current.*/
29036 // HV_PS.new_current_values_flag = false; /* Reset the new current value flag.*/
29037 // }
29038  }
29039  ((int)(bitmapstruct.element2 |= (1 << 5))); /* 16 */
29040  goto l129047 ;
29042  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ); /* 41 */
29043  /* Open the SPI port.*/
29044  {
29045 // if(HV_PS.drvSPIHandle == DRV_HANDLE_INVALID)
29046 // {
29047 // HV_PS.drvSPIHandle = DRV_SPI_Open( DRV_SPI_INDEX_2, /* Open SPI port for HVPS Control DAC.*/
29048 // DRV_IO_INTENT_WRITE );
29049 // }
29050 //
29051 // if(HV_PS.drvSPIHandle != DRV_HANDLE_INVALID) /* If the SPI port for the HV_PS control DAC has been opened,*/
29052 // {
29053 // HV_PS.state = HVPS_STATE_SHUTDOWN_CHECK; /* Move on to check for a shutdown event.*/
29054 // }
29055  }
29056  ((int)(bitmapstruct.element2 |= (1 << 7))); /* 16 */
29057  goto l129047 ;
29059  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 8) : 0)), 1 ); /* 41 */
29060  {
29061 // if((HV_PS.shutdown == true)||(WL_SPS.overcurrent_flag == true)|| /* If the power supply has shutdown for some reason,*/
29062 // ( WL_SPS.overvoltage_flag == true) ) /* or if we have an over voltage or over current condition,*/
29063 // {
29064 // HVPS_ONOFFOff(); /* Turn the HVPS off.*/
29065 // DMPLEDOn(); /* Turn the dump LED on to indicate an issue with the HVPS supply.*/
29066 // HV_PS.cont_prev = 0; /* Set the control count to 0.*/
29067 // HV_PS.count = 0; /* Reset count between previous and new values.*/
29068 // HV_PS.state = HVPS_STATE_SEND_CONT_V; /* Move on to send that count to the HVPS control DAC.*/
29069 //
29070 // if(HV_PS.SWITCH == false) /* If during shutdown the HVPS control pot is turned off,*/
29071 // {
29072 // HV_PS.shutdown = false; /* Reset the flags.*/
29073 // WL_SPS.overcurrent_flag = false;
29074 // WL_SPS.overvoltage_flag = false;
29075 // DMPLEDOff(); /* Turn the dump LED off.*/
29076 // ClearStatus( 3 ); /* Clear status bit to indicate overvoltage.*/
29077 // }
29078 // }
29079 // else /* Otherwise,*/
29080 // {
29081 // HV_PS.state = HVPS_STATE_READ_SWITCH; /* move onto read the control pot switch.*/
29082 // }
29083  }
29084  ((int)(bitmapstruct.element2 |= (1 << 9))); /* 16 */
29085  goto l129047 ;
29087  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 10) : 0)), 1 ); /* 41 */
29088  {
29089  if
29090  (
29091  HV_PS.pot_switch == false
29092  ) /* If the HVPS control pot has been turned off,*/
29093  {
29094  ((int)(bitmapstruct.element2 |= (1 << 11))); /* 1 */
29095  {
29096  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 ) ;/* Turn the HVPS on.*/
29097  HV_PS.state = HVPS_TEST_STATE_SET_CONT_V ; /* move on to read the control voltage from the pot.*/
29098  }
29099  ((int)(bitmapstruct.element2 |= (1 << 12))); /* 3 */
29100  }
29101  else /* Otherwise,*/
29102  {
29103  ((int)(bitmapstruct.element2 |= (1 << 13))); /* 2 */
29104  {
29105  PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 ) ;/* Turn the HVPS off.*/
29106  HV_PS.cont_prev = 0U ; /* Set the control count to 0.*/
29107  HV_PS.count = 0U ; /* Reset count between previous and new values.*/
29108  HV_PS.state = HVPS_STATE_SEND_CONT_V ; /* Move on to send that count to the HVPS control DAC.*/
29109  Clear_Status ( 5 ) ;/* Positive voltage not detected.*/
29110  Clear_Status ( 6 ) ;/* Negative voltage not detected.*/
29111  }
29112  }
29113  }
29114  ((int)(bitmapstruct.element2 |= (1 << 14))); /* 16 */
29115  goto l129047 ;
29117  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 15) : 0)), 1 ); /* 41 */
29118  /* Read the control voltage from the pot.*/
29119  {
29120  if
29121  (
29122  HV_PS.new_cont_values_flag == true
29123  ) /* If we have a new value from the ADC,*/
29124  {
29125  ((int)(bitmapstruct.element2 |= (1 << 16))); /* 1 */
29126  {
29127 // HV_PS.cont_in = ADC.hvps_cont; /* retrieve the value and*/
29128  HV_PS.cont_in = ADC.hvps_cont ; /* retrieve the value and*/
29129  HV_PS.new_cont_values_flag = false ; /* reset the flag.*/
29130  HV_PS.state = HVPS_STATE_CALC_SETTING ; /* Move on to calculate the DAC value.*/
29131  }
29132  } else ((int)(bitmapstruct.element2 |= (1 << 17))); /* 4 */
29133  }
29134  ((int)(bitmapstruct.element2 |= (1 << 18))); /* 16 */
29135  goto l129047 ;
29137  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 19) : 0)), 1 ); /* 41 */
29138  {
29139  HV_PS.cont_new = HV_PS.cont_in >> 4 ; /* Convert the 12-bit ADC reading to an 8-bit value.*/
29140  if
29141  (
29143  ) /* If the new control value is greater than the previous value,*/
29144  {
29145  ((int)(bitmapstruct.element2 |= (1 << 20))); /* 1 */
29146  {
29147  HV_PS.count = HV_PS.cont_new - HV_PS.cont_prev ; /* calculate the number of counts between the two values.*/
29148  HV_PS.pos_dir = true ; /* Set to true because the new pot value is greater than the previous.*/
29149  HV_PS.state = HVPS_STATE_ADJUST_CONT_V ; /* Move on to send the new value to the HV_PS control DAC.*/
29150  }
29151  ((int)(bitmapstruct.element2 |= (1 << 21))); /* 3 */
29152  }
29153  else
29154  {
29155  ((int)(bitmapstruct.element2 |= (1 << 22))); /* 2 */
29156  {
29157  if
29158  (
29160  ) /* If the new control value is less than the previous value,*/
29161  {
29162  ((int)(bitmapstruct.element2 |= (1 << 23))); /* 1 */
29163  {
29164  HV_PS.count = HV_PS.cont_prev - HV_PS.cont_new ;/* calculate the number of counts between the two values.*/
29165  HV_PS.pos_dir = false ;/* Set to false because the new pot value is less than the previous.*/
29166  HV_PS.state = HVPS_STATE_ADJUST_CONT_V ;/* Move on to send the new value to the HV_PS control DAC.*/
29167  }
29168  ((int)(bitmapstruct.element2 |= (1 << 24))); /* 3 */
29169  }
29170  else
29171  {
29172  ((int)(bitmapstruct.element2 |= (1 << 25))); /* 2 */
29173  {
29174  HV_PS.state = HVPS_STATE_READ_SWITCH ;/* There was no change. Go monitor the switch.*/
29175  }
29176  }
29177  }
29178  }
29179  }
29180  ((int)(bitmapstruct.element2 |= (1 << 26))); /* 16 */
29181  goto l129047 ;
29183  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 27) : 0)), 1 ); /* 41 */
29184  {
29185  if
29186  ( /* 50 */
29187  (
29188 
29189  ( /* 52 */
29190  (
29191  HV_PS.pos_dir == true
29192  )
29193  ? (bitmapstruct.element2 |= (1 << 28 ), 1)
29194  : (bitmapstruct.element2 |= (1 << 29 ), 0) ) /* 54 */
29195  &&
29196  ( HV_PS.count > 0U )
29197  ) /* If we are not through increasing the voltage,*/
29198  ) /* 1 */
29199  {
29200  ((int)(bitmapstruct.element2 |= (1 << 30))); /* 1 */
29201  {
29202  HV_PS.cont_prev = HV_PS.cont_prev + 1U ; /* Increment the previous control voltage value.*/
29203  HV_PS.count = HV_PS.count - 1U ; /* Decrement the difference count.*/
29204  }
29205  ((int)(bitmapstruct.element2 |= (1 << 31))); /* 3 */
29206  }
29207  else
29208  {
29209  ((int)(bitmapstruct.element3 |= (1 << 0))); /* 2 */
29210  {
29211  if
29212  ( /* 50 */
29213  (
29214 
29215  ( /* 52 */
29216  (
29217  HV_PS.pos_dir == false
29218  )
29219  ? (bitmapstruct.element3 |= (1 << 1 ), 1)
29220  : (bitmapstruct.element3 |= (1 << 2 ), 0) ) /* 54 */
29221  &&
29222  ( HV_PS.count > 0U )
29223  ) /* If we are not through decreasing the voltage,*/
29224  ) /* 1 */
29225  {
29226  ((int)(bitmapstruct.element3 |= (1 << 3))); /* 1 */
29227  {
29228  HV_PS.cont_prev = HV_PS.cont_prev - 1U ;/* Decrement the previous control voltage value.*/
29229  HV_PS.count = HV_PS.count - 1U ;/* Decrement the difference count.*/
29230  }
29231  ((int)(bitmapstruct.element3 |= (1 << 4))); /* 3 */
29232  }
29233  else
29234  {
29235  ((int)(bitmapstruct.element3 |= (1 << 5))); /* 2 */
29236  {
29237  /*Comment.*/
29238  }
29239  }
29240  }
29241  }
29243  }
29244  ((int)(bitmapstruct.element3 |= (1 << 6))); /* 16 */
29245  goto l129047 ;
29247  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 7) : 0)), 1 ); /* 41 */
29248  /* This updates the DAC at a fixed rate set by the HV_PS.update_rate.*/
29249  {
29250  if
29251  ( /* 50 */
29252  (
29253 
29254  ( /* 52 */
29255  (
29257  )
29258  ? (bitmapstruct.element3 |= (1 << 8 ), 1)
29259  : (bitmapstruct.element3 |= (1 << 9 ), 0) ) /* 54 */
29260  &&
29261  ( HV_PS.tick == true )
29262  ) /* If we have not counted to the update rate and we got a timer tick,*/
29263  ) /* 1 */
29264  {
29265  ((int)(bitmapstruct.element3 |= (1 << 10))); /* 1 */
29266  {
29267  HV_PS.tick = false ; /* Reset the Timer 1 tick*/
29268  HV_PS.update_count ++ ; /* and update the counter.*/
29269  }
29270  } else ((int)(bitmapstruct.element3 |= (1 << 11))); /* 4 */
29271  if
29272  (
29274  ) /* If we have counter to the update rate,*/
29275  {
29276  ((int)(bitmapstruct.element3 |= (1 << 12))); /* 1 */
29277  {
29278  HV_PS.update_count = 0U ; /* reset the counter and*/
29279  HV_PS.update_flag = true ; /* set the flag so we can update the DAC.*/
29280  }
29281  } else ((int)(bitmapstruct.element3 |= (1 << 13))); /* 4 */
29282  if
29283  ( /* 50 */
29284  (
29285 
29286  ( /* 52 */
29287  (
29288  HV_PS.update_flag == true
29289  )
29290  ? (bitmapstruct.element3 |= (1 << 14 ), 1)
29291  : (bitmapstruct.element3 |= (1 << 15 ), 0) ) /* 54 */
29292  &&
29293  ( HV_PS.spi_sent_flag == false )
29294  ) /* If the update flag is true and we have not sent a value to the HV_PS DAC,*/
29295  ) /* 1 */
29296  {
29297  ((int)(bitmapstruct.element3 |= (1 << 16))); /* 1 */
29298  {
29299  HV_PS.adj[ 0 ] = MAN_BIAS.dac_b_setting | ( HV_PS.cont_prev & 0x00FFU ) ;/* Configure the SPI data to write to the DAC B only.*/
29302 //
29303 // HV_PS.bufferHandle = DRV_SPI_BufferAddWrite2(HV_PS.drvSPIHandle, /* write the control setting to the HV_PS control DAC.*/
29304 // &HV_PS.ADJ, sizeof(HV_PS.ADJ), SPI_4_EventHandler, NULL,
29305 // &HV_PS.bufferHandle2 );
29306  HV_PS.spi_sent_flag = true ; /* Set this flag to show we sent data to the HV_PS DAC SPI port.*/
29307  HV_PS.update_flag = false ; /* Reset the flag.*/
29308  }
29309  } else ((int)(bitmapstruct.element3 |= (1 << 17))); /* 4 */
29310  if
29311  (
29313  ) /* If the SPI port is through sending data,*/
29314  {
29315  ((int)(bitmapstruct.element3 |= (1 << 18))); /* 1 */
29316  {
29317  HV_PS.spi_write_complete_flag = false ; /* reset the flag.*/
29318  HV_PS.spi_sent_flag = false ; /* Reset the flag so we can send data.*/
29319  if
29320  (
29321  HV_PS.count == 0U
29322  ) /* If we have gone through all of the counts,*/
29323  {
29324  ((int)(bitmapstruct.element3 |= (1 << 19))); /* 1 */
29325  {
29326  HV_PS.cont_prev = HV_PS.cont_new ; /* Ensure the previous value equals the new value.*/
29327  HV_PS.state = HVPS_STATE_SHUTDOWN_CHECK ; /* Move on to check for a shutdown.*/
29328  }
29329  ((int)(bitmapstruct.element3 |= (1 << 20))); /* 3 */
29330  }
29331  else /* Otherwise,*/
29332  {
29333  ((int)(bitmapstruct.element3 |= (1 << 21))); /* 2 */
29334  {
29335  HV_PS.state = HVPS_STATE_ADJUST_CONT_V ; /* keep adjusting the control voltage.*/
29336  }
29337  }
29338  }
29339  } else ((int)(bitmapstruct.element3 |= (1 << 22))); /* 4 */
29340  }
29341  ((int)(bitmapstruct.element3 |= (1 << 23))); /* 16 */
29342  goto l129047 ;
29344  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 24) : 0)), 1 ); /* 41 */
29345  {
29346  if
29347  (
29349  ) /* If a new value is available, check*/
29350  {
29351  ((int)(bitmapstruct.element3 |= (1 << 25))); /* 1 */
29352  {
29353  if
29354  (
29356  ) /* if the ADC reading is greater than the zero current offset reading,*/
29357  {
29358  ((int)(bitmapstruct.element3 |= (1 << 26))); /* 1 */
29359  {
29360  HV_PS.current = ADC.hvps_i - HV_PS.sensor_offset ; /* Determine the counts for a positive current.*/
29361  }
29362  ((int)(bitmapstruct.element3 |= (1 << 27))); /* 3 */
29363  }
29364  else /* Otherwise,*/
29365  {
29366  ((int)(bitmapstruct.element3 |= (1 << 28))); /* 2 */
29367  {
29368  HV_PS.current = HV_PS.sensor_offset - ADC.hvps_i ; /* determine the counts for a negative current.*/
29369  }
29370  }
29371  HV_PS.current = HV_PS.current - HV_PS.offset ; /* Add the offset to the current reading.*/
29372  HV_PS.current = HV_PS.current * HV_PS.sensor_constant ; /* Convert ADC counts to mA. The current is an absolute value. No polarity indication.*/
29373  if
29374  (
29376  ) /* Check for a maximum current reading.*/
29377  {
29378  ((int)(bitmapstruct.element3 |= (1 << 29))); /* 1 */
29379  {
29381  }
29382  } else ((int)(bitmapstruct.element3 |= (1 << 30))); /* 4 */
29383  HV_PS.new_current_values_flag = false ; /* Reset the new current value flag.*/
29384  HV_PS.state = HVPS_STATE_CHECK_OVERCURRENT ; /* Move on to the overcurrent check.*/
29385  }
29386  } else ((int)(bitmapstruct.element3 |= (1 << 31))); /* 4 */
29387  }
29388  ((int)(bitmapstruct.element4 |= (1 << 0))); /* 16 */
29389  goto l129047 ;
29391  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 1) : 0)), 1 ); /* 41 */
29392  {
29393  if
29394  (
29396  ) /* HV_PS Current has exceeded current limit,*/
29397  {
29398  ((int)(bitmapstruct.element4 |= (1 << 2))); /* 1 */
29399  {
29400  HV_PS.over_current_count ++ ; /* Increment occurrence count.*/
29401  if
29402  (
29404  ) /* If it exceeds limit 5 times in a row,*/
29405  {
29406  ((int)(bitmapstruct.element4 |= (1 << 3))); /* 1 */
29407  {
29408  HV_PS.overcurrent_flag = true ;
29409  }
29410  } else ((int)(bitmapstruct.element4 |= (1 << 4))); /* 4 */
29411  }
29412  ((int)(bitmapstruct.element4 |= (1 << 5))); /* 3 */
29413  }
29414  else
29415  {
29416  ((int)(bitmapstruct.element4 |= (1 << 6))); /* 2 */
29417  {
29418  HV_PS.overcurrent_flag = false ; /* Reset flag.*/
29419  HV_PS.over_current_count = 0U ; /* Reset Count.*/
29420  }
29421  }
29422  HV_PS.state = HVPS_STATE_READ_VOLTAGE ; /* Go read the wire-line voltage.*/
29423  }
29424  ((int)(bitmapstruct.element4 |= (1 << 7))); /* 16 */
29425  goto l129047 ;
29427  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 8) : 0)), 1 ); /* 41 */
29428  {
29429  HV_PS.state = HVPS_STATE_SHUTDOWN_CHECK ; /* Move on to check for a shutdown event.*/
29430  }
29431  ((int)(bitmapstruct.element4 |= (1 << 9))); /* 16 */
29432  goto l129047 ;
29433  default :
29434  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 10) : 0)), 1 ); /* 41 */
29435  {
29436  }
29437  ((int)(bitmapstruct.element4 |= (1 << 11))); /* 16 */
29438  goto l129047 ;
29439  }
29440 l129047 :
29441  ; /* 18 */
29442  ((int)(bitmapstruct.element4 |= (1 << 12))); /* 30 */
29443  hvps_test_67zqendz ( 141 ) ; /* 30 */
29444  }
29445 /***************************************************************************************
29446  End of File
29447  */
29448 #define qqqbranches 141
29449 #define QQQMAXMCDCSIZE 2
29450 /********************** LDRA_PORT INSTRUMENTATION **********************/
29451 
29452 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
29453 #define ldra_sscanf
29454  /* put in undefs to protect our parameter names from macros */
29455 #undef f
29456 #undef i
29457 #undef j
29458 #undef k
29459 #undef s
29460 #undef l
29461 #undef ii
29462 #undef some
29463 #undef none
29464 #undef from
29465 #undef a
29466 #undef b
29467 #undef iz
29468 #undef jz
29469 #undef qqnull_params
29470 #define qqnull_params void
29471  /* Conventional Instrumentation */
29472 #define qqzzidfield 1
29473  /* single file or fileid */
29474  /* these have an extra field for the fileid */
29475  static char qqqqone[] = "%6d\n"; /* single point */
29476  /* uncompressed data structures */
29477  /* uncompressed bitmap */
29478 #define QQQFIXEDSIZE
29479  static int qqqlast = 0;
29480  extern int qqupload_registered;
29481  extern int hvps_test_67zqqzqz(qqnull_params);
29482  extern int hvps_test_67zqqzqz1(qqnull_params);
29483  /* ----------------------------------------------------------------------* 200 *
29484  * Procedures
29485  * -----------------------------------------------------------------------------
29486  */
29487  /* ----------- zscanf ---------------------------------------------------* 201 *
29488  * Returns an integer extracted from a string
29489  * -----------------------------------------------------------------------------
29490  */
29491  static int hvps_test_67zscanf(char * qqscan_str)
29492  {
29493  int qqvalue;
29494  int qqisign;
29495  char * qqcptr;
29496  qqvalue = 0;
29497  qqisign = 1;
29498  qqcptr = qqscan_str;
29499  /* Skip spaces */
29500  while (qqcptr[0] == ' ')
29501  {
29502  qqcptr++;
29503  }
29504  /* Check for a leading ---
29505  */
29506  if (qqcptr[0] == '-')
29507  {
29508  qqisign = -1;
29509  qqcptr++;
29510  }
29511  /* Extract digits */
29512  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
29513  {
29514  qqvalue = 10 * qqvalue;
29515  qqvalue = qqvalue + (qqcptr[0] - '0');
29516  qqcptr++;
29517  }
29518  qqvalue = qqisign * qqvalue;
29519  return qqvalue;
29520  } /* end of zscanf */
29521  /* ----------------------------------------------------------------------* 210 *
29522  * C System utilities in use:
29523  * fprintf
29524  * fclose
29525  * sscanf
29526  * -----------------------------------------------------------------------------
29527  */
29528  /* ----------------------------------------------------------------------* 213 *
29529  * qqoutput* suite
29530  * Main output routines. These may require modification.
29531  * -----------------------------------------------------------------------------
29532  */
29533  /* ----------------------------------------------------------------------* 214 *
29534  * qqoutput
29535  * This is the principle output routine.
29536  * -----------------------------------------------------------------------------
29537  */
29538  static void qqoutput(FILEPOINT char * s,int i)
29539  /* f - file pointer, s - format string, i - integer for probe value */
29540  {
29541  /* printing to a file */
29542  /* fprintf exists, not threaded */
29543  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
29544  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
29545  ldra_port_write (&ldra_buffer[0]);
29546  } /* end of qqoutput */
29547  /* ----------------------------------------------------------------------* 215 *
29548  * qqoutput0
29549  * -----------------------------------------------------------------------------
29550  */
29551  static void qqoutput0(FILEPOINT char * s)
29552  {
29553  ldra_port_write(s);
29554  } /* end of qqoutput0 */
29555  /* ----------------------------------------------------------------------* 216 *
29556  * qqoutput2
29557  * -----------------------------------------------------------------------------
29558  */
29559  static void qqoutput2(FILEPOINT char * s,int i, int j)
29560  {
29561  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
29562  ldra_port_write (&ldra_buffer[0]);
29563  } /* end of qqoutput2 */
29564  /* ----------------------------------------------------------------------* 217 *
29565  * qqoutput3
29566  * -----------------------------------------------------------------------------
29567  */
29568  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
29569  {
29570  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
29571  ldra_port_write (&ldra_buffer[0]);
29572  } /* end of qqoutput3 */
29573  /* ----------------------------------------------------------------------* 218 *
29574  * qqoutput4
29575  * -----------------------------------------------------------------------------
29576  */
29577  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
29578  {
29579  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
29580  ldra_port_write (&ldra_buffer[0]);
29581  } /* end of qqoutput4 */
29582  /* ----------------------------------------------------------------------* 219 *
29583  * end of qqoutput* suite
29584  * -----------------------------------------------------------------------------
29585  */
29586  /* ----------------------------------------------------------------------* 222 *
29587  * qqqqinitialise
29588  * This procedure initialises the structures for
29589  * compressed execution histories.
29590  * -----------------------------------------------------------------------------
29591  */
29592  static void qqqqinitialise(int ii)
29593  {
29594  unsigned int i;
29595  /* First time through. */
29596  /* bitmap */
29597  /* bitmap separate */
29598  qqqlast = 1; /* stops qqfun() calling initialise again */
29599  /* bitmap */
29600  /* bitmap singlefile */
29601  /* struct singlefile notmainfl */
29602  } /* end of qqqqinitialise */
29603 /* ----------------------------------------------------------------------* 225 *
29604 * qqqbitmapreset
29605 * This procedure resets the structures for
29606 * compressed execution histories.
29607 * -----------------------------------------------------------------------------
29608 */
29609 static void qqqbitmapreset()
29610 {
29611 struct bitmapstruct_t localbitmap = {0};
29612 bitmapstruct = localbitmap;
29613 } /* end of qqqbitmapreset */
29614 #undef QQQTEMP1
29615 #define QQQTEMP1
29616  /* ----------- zqqzqz ---------------------------------------------------* 310 *
29617  * -----------------------------------------------------------------------------
29618  */
29619  /* ----------------------------------------------------------------------* 312 *
29620  * This routine opens the execution history file. It is instrumented at the
29621  * start of the main program if one exists in the file. In general this is
29622  * superceded by hvps_test_67zqqzqz1 below.
29623  * -----------------------------------------------------------------------------
29624  */
29626  {
29627  if ( hvps_test_67zzopen != 1 )
29628  {
29629 #undef QQQMUSTOPEN
29630  hvps_test_67zzopen = 1;
29631  }
29632  return(1);
29633  } /* end of zqqzqz */
29634  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
29635  * -----------------------------------------------------------------------------
29636  */
29637  /* ----------------------------------------------------------------------* 317 *
29638  * This routine also opens the execution history file. It is called
29639  * automatically if a probe fires and the execution history is not already
29640  * opened (hvps_test_67zzopen = 0 ).
29641  * Because this always works ( it was intended for files with no main program
29642  * it is now the de facto common way to open the execution history.
29643  * -----------------------------------------------------------------------------
29644  */
29646  {
29647  if ( hvps_test_67zzopen != 1 )
29648  {
29649  ldra_port_open(); /* 7 */
29650  qqqqinitialise(0);
29651  hvps_test_67zzopen = 1;
29652  }
29653  return(1);
29654  } /* end of zqqzqz1 */
29655  /* ----------- zqendz ---------------------------------------------------* 330 *
29656  * This routine is called on exiting a routine in a
29657  * module. It closes the execution history.
29658  * -----------------------------------------------------------------------------
29659  */
29660 static int hvps_test_67zqendz(int qqqi)
29661  {
29662  if (!qqqstructzzopen)
29663  {
29665  qqqstructzzopen = 1;
29666  }
29667  if ( hvps_test_67zzopen != 1 )
29668  {
29670  }
29671  /* ----------------------------------------------------------------------* 331 *
29672  * this is the one which puts an integer into
29673  * the execution history file and returns unity.
29674  * The format of each field consists of six columns,
29675  * the number is right justified in this field.
29676  * -----------------------------------------------------------------------------
29677  */
29678  if ( hvps_test_67zzopen )
29679  {
29680  /* uncompressed */
29681  /* uncompressed unbuffered */
29682  /* uncompressed unbuffered bitmap */
29683  if ( qqqi > 0 )
29684  {
29685  }
29686  else
29687  {
29688  }
29689  }
29690  qqqlast = 0;
29691  return(1);
29692  } /* end of zqendz */
29693  /* ----------------------------------------------------------------------* 335 *
29694  * Output structure - qqbmsoutput
29695  * -----------------------------------------------------------------------------
29696  */
29697  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
29698  {
29699  static int branches_printed = 0;
29700  int b, last = 0;
29701  for(b=0;b<qqqqbmselwidth/8;b++)
29702  {
29703  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
29704  ldra_port_write (&ldra_buffer[0]);
29705  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
29706  ldra_port_write (&ldra_buffer[0]);
29707  last += 8;
29708  branches_printed += 8;
29709  if (branches_printed >= qqqbranches)
29710  {
29711  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
29712  break;
29713  }
29714  }
29715  }
29716  /* ----------------------------------------------------------------------* 336 *
29717  * qqqupload
29718  * This routine loops through the stored bitmap and
29719  * outputs it. It then uploads the stored mcdc.
29720  * -----------------------------------------------------------------------------
29721  */
29722  static void qqqupload(qqnull_params)
29723  {
29724  int i;
29725  /* uncompressed bitmap (!singlefile or mainfl) separate */
29726  {
29728 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
29729 #define LASTELEMENT
29730 #include "hvps_test_67zbelem.def"
29731 #undef LASTELEMENT
29732 #undef ELEMENT
29733  }
29734  /* bitmap separate */
29735  qqqlast = 1; /* stops qqfun() calling initialise again */
29736  } /* end of qqqupload */
29737  /* ----------- zqzqzq ---------------------------------------------------* 342 *
29738  * -----------------------------------------------------------------------------
29739  */
29740  /* ----------------------------------------------------------------------* 344 *
29741  * This routine should be called before the program
29742  * terminates. It closes the execution history
29743  * -----------------------------------------------------------------------------
29744  */
29745  static int hvps_test_67zqzqzq(int qqqi)
29746  {
29747  if ( hvps_test_67zzopen != 1 )
29748  {
29750  }
29751  /* not compressed */
29752  /* do nothing for bitmap*/
29753  /* upload the history */
29754  /* bitmap */
29755  /* uncompressed bitmap */
29756  hvps_test_67zqendz(qqqi);
29757  /* qqqupload closes the execution history file */
29758  return(1);
29759  } /* end of zqzqzq */
29760  /* the following routines should be left alone */
29761 /* END OF TESTBED INSTRUMENTATION */
29762 
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
void DRV_ADC0_Close(void)
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
static void DRV_TMR2_Close(void)
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
static void DRV_TMR3_Tasks(void)
void DRV_TMR1_PeriodValueSet(uint32_t value)
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
DRV_USART_BUFFER_RESULT
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1)
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
uint32_t DRV_TMR2_PeriodValueGet(void)
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
#define FILEPOINT
int QQQindicator
Definition: inszt_main.c:104
DRV_USART_CLIENT_STATUS
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
HVPS_TEST_DATA HV_T_PS
void PLIB_DMA_Disable(DMA_MODULE_ID index)
ADC_DATA ADC
Definition: adc.c:53
uint32_t SYS_DMA_ChannelCRCGet(void)
void DRV_USART_Close(const DRV_HANDLE handle)
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
static char qqqqone[]
SYS_DMA_CRC_WRITE_ORDER
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void Set_Bias(uint8_t value)
Definition: inszt_man.c:30592
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
static void DRV_TMR2_Tasks(void)
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
static void DRV_TMR1_Tasks(void)
static void DRV_TMR2_DeInitialize(void)
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
uintptr_t SYS_DMA_CHANNEL_HANDLE
static void DRV_TMR1_DeInitialize(void)
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
SYS_DMA_CHANNEL_IGNORE_MATCH
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
uint32_t DRV_TMR3_CounterValueGet(void)
MAN_RX_STATES
void DRV_TMR0_CounterValueSet(uint32_t value)
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t cont_in
Definition: hvps.h:94
void DRV_TMR2_PeriodValueSet(uint32_t value)
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
static void DRV_TMR0_Close(void)
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_ERROR_LEVEL gblErrLvl
float float32_t
Definition: cf.h:50
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void DRV_TMR1_CounterClear(void)
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
static HVPS_TEST_STATES H_T_STATES
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
#define hvps_test_67zzopen
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
void DRV_USART0_Close(void)
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
void SYS_DMA_Resume(void)
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
Definition: hvps.h:84
int qqupload_registered
Definition: inszt_main.c:6760
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
uint16_t count
Definition: hvps.h:101
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
HVPS_TEST_STATES state
Definition: hvps_test.h:88
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
uint16_t cont_prev
Definition: hvps.h:99
void DRV_TMR4_StopInIdleDisable(void)
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
DRV_SPI_CLOCK_MODE
WL_SPS_STATES
Definition: inszt_app.c:28425
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
void Prepare_Return_B(uint8_t byt [])
uintptr_t DRV_HANDLE
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
DRV_TMR_CLIENT_STATUS
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
void PLIB_SPI_Enable(SPI_MODULE_ID index)
uint16_t update_count
Definition: hvps.h:108
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
bool pot_switch
Definition: hvps.h:96
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
static void DRV_TMR2_Open(void)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
void DRV_TMR0_StopInIdleDisable(void)
void DRV_PMP0_ModeConfig(void)
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
DRV_USART_ERROR
void DRV_TMR0_PeriodValueSet(uint32_t value)
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
void DRV_TMR0_CounterClear(void)
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint32_t DRV_TMR0_CounterValueGet(void)
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
#define qqnull_params
static void qqqqinitialise(int ii)
bool spi_write_complete_flag
Definition: hvps.h:90
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
SYS_DMA_DATA_WIDTH
uint16_t hvps_i
Definition: adc.h:83
SYS_DMA_ERROR
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
uint16_t PORTS_DATA_MASK
ADC_STATES
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_TMR0_PeriodValueGet(void)
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
HVPS_DATA HV_PS
Definition: hvps.c:56
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
bool tick
Definition: hvps.h:98
WL_SPS_STATES
MAN_PROCESS_STATES
Definition: inszt_app.c:29386
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
DRV_SPI_PROTOCOL_TYPE
void DRV_IC0_Start(void)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void Init_Manchester(void)
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
static int qqqisinitialised
Definition: inszt_main.c:152
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
uint16_t sensor_constant
Definition: hvps.h:115
static bool Check_Manchester(void)
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
static int qqqstructzzopen
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
void DRV_TMR3_StopInIdleEnable(void)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
#define DRV_IC_Close(handle)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR4_CounterClear(void)
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void qqqupload(qqnull_params)
void DRV_USART0_WriteByte(const uint8_t byte)
void DRV_USART0_TasksError(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
#define qqqbranches
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool DRV_SPIn_ReceiverBufferIsFull(void)
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
static SYS_STATUS DRV_TMR3_Status(void)
void DRV_TMR_Stop(DRV_HANDLE handle)
uint16_t sensor_offset
Definition: hvps.h:113
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
bool update_flag
Definition: hvps.h:109
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
bool DRV_TMR4_Start(void)
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
void PLIB_USART_Enable(USART_MODULE_ID index)
DRV_TMR_CLK_SOURCES
void PLIB_SPI_Disable(SPI_MODULE_ID index)
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
DRV_SPI_MODE
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
uint16_t cont_new
Definition: hvps.h:100
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
DRV_SPI_BUFFER_TYPE
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
void DRV_TMR1_Initialize(void)
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
void DRV_ADC_Initialize(void)
void DRV_ADC1_Close(void)
static void DRV_TMR4_Close(void)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
static int hvps_test_67zqqzqz(qqnull_params)
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint32_t DRV_TMR1_CounterFrequencyGet(void)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void DRV_TMR1_CounterValueSet(uint32_t value)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
static int hvps_test_67zqzqzq(int qqqi)
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
uint8_t DRV_USART0_ReadByte(void)
bool DRV_IC0_BufferIsEmpty(void)
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
void DRV_TMR_Close(DRV_HANDLE handle)
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
float float32_t
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void MAN_PROCESS_Tasks(void)
DRV_USART_LINE_CONTROL
uint32_t baudRate
Definition: inszt_adc.c:26572
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
DRV_SPI_BUFFER_EVENT
void SYS_PORTS_Initialize()
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
static int QQQfirstmcdc
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
uint8_t DRV_PMP0_Read(void)
void DRV_TMR4_StopInIdleEnable(void)
APP_DATA APP
Definition: app.c:73
void APP_Tasks(void)
Definition: app.c:130
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
void Set_WL_SPS_CurrentLimit(uint16_t value)
uint16_t current
Definition: hvps.h:112
static void Flush_Buffer_Manchester(void)
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
void HVPS_Tasks(void)
Definition: hvps.c:117
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
MAN_BIAS_DATA MAN_BIAS
Definition: man.c:65
void DRV_TMR_CounterClear(DRV_HANDLE handle)
bool SYS_DMA_IsBusy(void)
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
static void DRV_TMR4_Open(void)
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
void qqqtotalreset(void)
Definition: inszt_main.c:7067
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
static SYS_STATUS DRV_TMR4_Status(void)
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
void DRV_USART0_TasksReceive(void)
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
void DRV_TMR4_PeriodValueSet(uint32_t value)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
uint32_t DRV_TMR2_CounterFrequencyGet(void)
void SYS_DEBUG_Print(const char *format,...)
MAN_PROCESS_STATES
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
void DRV_PMP0_Write(uint8_t data)
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
bool DRV_TMR0_Start(void)
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
void DRV_IC0_Stop(void)
int QQQfcn_ptr_num
Definition: inszt_main.c:151
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
void PLIB_DMA_Enable(DMA_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
uint16_t hvps_cont
Definition: adc.h:84
DRV_USART_INIT_FLAGS
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
uint16_t max_current
Definition: hvps.h:116
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
bool DRV_USART0_ReceiverBufferIsEmpty(void)
DRV_IO_INTENT
Definition: inszt_adc.c:975
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
DRV_IO_INTENT
bool pos_dir
Definition: hvps.h:103
void DRV_TMR2_Initialize(void)
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
uint32_t DRV_IC0_Capture32BitDataRead(void)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_HANDSHAKE
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
HVPS_STATES
uint32_t DRV_TMR4_PeriodValueGet(void)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
void DRV_ADC0_Open(void)
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
SYS_DMA_TRANSFER_EVENT
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
void DRV_ADC1_Open(void)
void DRV_TMR2_CounterClear(void)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
uint16_t adj[1]
Definition: hvps.h:93
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
static int qqqqbmselwidth
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
void DRV_TMR3_CounterClear(void)
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
MAN_STATES
Definition: inszt_app.c:29350
void DRV_TMR2_CounterValueSet(uint32_t value)
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_DMA_CHANNEL_OP_MODE
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_HANDLE spi_bias_fsk
Definition: inszt_app.c:29445
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
DRV_IO_BUFFER_TYPES
DRV_SPI_BUFFER_HANDLE bufferHandle2
Definition: inszt_app.c:29447
bool spi_sent_flag
Definition: hvps.h:91
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
void SYS_DMA_Suspend(void)
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
uint16_t dac_b_setting
Definition: inszt_app.c:29450
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
void DRV_SPI_Close(DRV_HANDLE handle)
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
void DRV_ADC_DeInitialize(void)
static SYS_STATUS DRV_TMR2_Status(void)
void(* ldra_void_function)()
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
ADC_STATES
Definition: adc.h:55
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
bool DRV_SPIn_TransmitterBufferIsFull(void)
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
void Clear_Status(uint8_t bitposn)
uint16_t update_rate
Definition: hvps.h:106
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
struct _DRV_SPI_INIT DRV_SPI_INIT
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
bool overcurrent_flag
Definition: hvps.h:124
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void Set_Status(uint8_t bitposn)
uint32_t DRV_TMR2_CounterValueGet(void)
void DRV_TMR3_Initialize(void)
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
static void qqoutput2(FILEPOINT char *s, int i, int j)
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
static int hvps_test_67zqendz(int qqqi)
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
void MAN_Tasks(void)
Definition: inszt_man.c:29645
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
void DRV_TMR4_Initialize(void)
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
uint16_t current_limit
Definition: hvps.h:117
void SPI_5_EventHandler(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
MAN_STATES
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
bool DRV_TMR2_Start(void)
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
static void DRV_TMR3_Open(void)
DRV_SPI_TASK_MODE
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
static void qqoutput0(FILEPOINT char *s)
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
static int hvps_test_67zscanf(char *qqscan_str)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_ERROR
Definition: inszt_adc.c:15426
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
HVPS_STATES
Definition: hvps.h:54
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
bool new_current_values_flag
Definition: hvps.h:122
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
uint8_t queueSize
Definition: inszt_adc.c:26592
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
int qqqshell_upload
Definition: inszt_main.c:150
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
DRV_USART_TRANSFER_STATUS
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
void DRV_TMR1_StopInIdleDisable(void)
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
DRV_CLIENT_STATUS
void DRV_TMR2_StopInIdleEnable(void)
static SYS_STATUS DRV_TMR1_Status(void)
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
void DRV_TMR2_Stop(void)
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
static void DRV_TMR4_Tasks(void)
HVPS_TEST_STATES
Definition: hvps_test.h:55
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
static void qqoutput(FILEPOINT char *s, int i)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
static float32_t Calc_Fsk_Scaling(void)
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
SYSTEM_OBJECTS sysObj
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
HVPS_TEST_STATES
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
SYS_ERROR_LEVEL
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
#define DRV_IC_Open(drvIndex, intent)
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
void DRV_IC0_Initialize(void)
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
WL_SPS_DATA WL_SPS
Definition: wl_sps.c:59
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
static int tbrun_mode
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
void DRV_TMR3_StopInIdleDisable(void)
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
#define hvps_test_67zqqzqz1
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
void HVPS_Test_Tasks(void)
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
static void DRV_TMR3_DeInitialize(void)
void DRV_TMR0_StopInIdleEnable(void)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
bool new_cont_values_flag
Definition: hvps.h:97
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void Decode_Manchester(void)
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_STATUS DRV_USART0_Status(void)
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void WL_SPS_Tasks(void)
void APP_Initialize(void)
Definition: app.c:93
void DRV_TMR4_CounterValueSet(uint32_t value)
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
static void DRV_TMR0_DeInitialize(void)
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool DRV_TMR_Start(DRV_HANDLE handle)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR3_Close(void)
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
static void DRV_TMR0_Tasks(void)
SYS_DMA_SIDL
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
uint32_t DRV_TMR4_CounterValueGet(void)
uint32_t DRV_TMR3_CounterFrequencyGet(void)
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
static SYS_STATUS DRV_TMR0_Status(void)
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
SYS_DMA_CHANNEL_CRC_MODE
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
void DRV_TMR3_CounterValueSet(uint32_t value)
void DRV_TMR2_StopInIdleDisable(void)
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
DRV_USART_OPERATION_MODE
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
static void DRV_TMR0_Open(void)
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void DRV_TMR1_StopInIdleEnable(void)
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
static int qqqlast
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static unsigned char qqqzzglobflag
uint32_t PORTS_DATA_TYPE
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
void DRV_USART0_Deinitialize(void)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
uint32_t DRV_TMR1_PeriodValueGet(void)
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
void DRV_IC_Stop(DRV_HANDLE handle)
HVPS_STATES state
Definition: hvps.h:86
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
bool DRV_TMR1_Start(void)
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
Definition: app.h:59
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
void ADC_Tasks(void)
Definition: adc.c:75
static int zzfileid
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
Definition: adc.h:78
void DRV_TMR4_Stop(void)
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
#define QQQnumfil
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
void Set_HVPS_Ramp_Rate(uint16_t value)
Definition: hvps.c:89
void DRV_TMR1_Stop(void)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
DRV_ADC_MODULE_ID
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
uint8_t count
Definition: inszt_man.c:29594
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void DRV_TMR4_DeInitialize(void)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
static void DRV_TMR1_Open(void)
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
void SET_WL_SPS_IOffset(uint8_t mode)
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
MAN_RX_STATES
Definition: inszt_app.c:29370
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
bool DRV_TMR3_Start(void)
static void Package_Manchester(void)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
void PLIB_USART_Disable(USART_MODULE_ID index)
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
static void Test_Manchester(void)
uintptr_t DRV_SPI_BUFFER_HANDLE
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE bufferHandle
Definition: inszt_app.c:29446
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
void DRV_TMR0_Stop(void)
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
uintptr_t DRV_USART_BUFFER_HANDLE
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR3_PeriodValueSet(uint32_t value)
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
uint16_t DRV_IC0_Capture16BitDataRead(void)
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void DRV_ADC_Stop(void)
SYS_PORTS_PIN_DIRECTION
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
SYS_DMA_CHANNEL_CHAIN_PRIO
DRV_USART_BAUD_SET_RESULT
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
uint8_t over_current_count
Definition: hvps.h:119
static struct bitmapstruct_t bitmapstruct
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART0_TasksTransmit(void)
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
static void qqqbitmapreset(qqnull_params)
void DRV_ADC_Start(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
bool DRV_USART0_TransmitBufferIsFull(void)
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
void Calc_Auto_Bias(void)
Definition: inszt_man.c:30558
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
void MAN_RX_Tasks(void)
Definition: inszt_man.c:29829
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
uint32_t DRV_TMR1_CounterValueGet(void)
MAN_DATA MAN
Definition: man.c:67
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
void DRV_TMR3_Stop(void)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
void DRV_TMR0_Initialize(void)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
uint16_t offset
Definition: hvps.h:114
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
static void DRV_TMR1_Close(void)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
uint32_t DRV_TMR3_PeriodValueGet(void)
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
DRV_TMR_OPERATION_MODE
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
DRV_USART_BUFFER_EVENT
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_PIN_INTERRUPT_TYPE
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
void SYS_DEBUG_Message(const char *message)
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
void DRV_PMP0_Initialize(void)